Remove individual blacklisting of music in GameCreateView and update all related music to blacklisted in GameEndView
Fix #8
This commit is contained in:
parent
cb3518a5e5
commit
22bb6931e8
1 changed files with 3 additions and 2 deletions
|
@ -327,8 +327,6 @@ class GameCreateView(LoginRequiredMixin, CreateView):
|
|||
pm_list = list(zip(players, musics))
|
||||
random.shuffle(pm_list)
|
||||
for (player, music), order in zip(pm_list, range(1, len(pm_list) + 1)):
|
||||
music.blacklisted = True
|
||||
music.save()
|
||||
models.MusicGameOrder.objects.create(
|
||||
game=form.instance, player=player, music_video=music, order=order
|
||||
)
|
||||
|
@ -481,6 +479,9 @@ class GameEndView(LoginRequiredMixin, SingleObjectMixin, View):
|
|||
if not game.group.is_leader(request.user):
|
||||
raise PermissionDenied()
|
||||
game.over = True
|
||||
models.MusicVideo.objects.filter(musicgameorder__game=game).update(
|
||||
blacklisted=True
|
||||
)
|
||||
|
||||
for go in game.musicgameorder_set.all():
|
||||
go.update_value()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue