Allow users to report spam links
This commit is contained in:
parent
651d468b13
commit
78dd5caf9f
20 changed files with 310 additions and 151 deletions
|
@ -13,14 +13,12 @@ class Report(BookWyrmModel):
|
|||
note = models.TextField(null=True, blank=True)
|
||||
user = models.ForeignKey("User", on_delete=models.PROTECT)
|
||||
statuses = models.ManyToManyField("Status", blank=True)
|
||||
links = models.ManyToManyField("Link", blank=True)
|
||||
resolved = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
"""don't let users report themselves"""
|
||||
"""set order by default"""
|
||||
|
||||
constraints = [
|
||||
models.CheckConstraint(check=~Q(reporter=F("user")), name="self_report")
|
||||
]
|
||||
ordering = ("-created_date",)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue