diff --git a/Show/templates/create_ban.html b/Show/templates/create_ban.html index 2a390d6..3ec4a4e 100644 --- a/Show/templates/create_ban.html +++ b/Show/templates/create_ban.html @@ -27,7 +27,8 @@ {% csrf_token %}

Banning user {{ target.display_name }}

{{ form }} - + + diff --git a/Show/views.py b/Show/views.py index 8c8a55d..f9d4d96 100644 --- a/Show/views.py +++ b/Show/views.py @@ -140,7 +140,6 @@ def SubmissionModForm(req, abbr, submission): # Handle POST if req.method == 'POST': - if 'delete' in req.POST: submission.delete() return HttpResponseRedirect('/show/%s/episode/%d/%d'%(abbr, episode.season.number, episode.episode)) @@ -329,6 +328,10 @@ def BanFromShowForm(req, abbr): # Add show to scope new_ban.scope.add(show) + # Delete all of the user's submissions for this show + if 'delete' in req.POST: + Submission.objects.filter(episode__show=show,user=banTarget).delete() + return HttpResponseRedirect('/show/%s'%(abbr)) else: ctx['error'] = 'Invalid fields!'