Commit 8a33f6da authored by Evert Prants's avatar Evert Prants

Add a show field to reports

parent f3bf9a4e
......@@ -330,6 +330,7 @@ def ReportForm(req, abbr, rid):
new_report = form.save(commit=False)
new_report.reporter = user
new_report.url = url
new_report.show = show
new_report.save()
return HttpResponseRedirect('%s/discuss/board/%d-%s'%(show.url(), reply.board.pk, slugify(reply.board.title)))
......
......@@ -196,6 +196,13 @@ class Report(TimestampedModel):
help_text='The URL of the content being reported',
verbose_name = 'Content URL'
)
show = models.ForeignKey(
Show,
on_delete=models.CASCADE,
null=True,
blank=True,
help_text='The show associated with the reported url',
)
read_by = models.ForeignKey(
User,
on_delete=models.SET_NULL,
......
......@@ -452,6 +452,7 @@ def ReportSubmission(req, abbr, submission):
new_report = form.save(commit=False)
new_report.reporter = user
new_report.url = url
new_report.show = show
new_report.save()
return HttpResponseRedirect('%s/episode/%d/%d'%(show.url(), episode.season.number, episode.episode))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment