Add a show field to reports
This commit is contained in:
parent
f3bf9a4e44
commit
8a33f6da59
@ -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))
|
||||
|
Reference in New Issue
Block a user