1
0
Fork 0

Allow reports with no associated user

This commit is contained in:
Mouse Reeve 2022-07-05 17:19:03 -07:00
parent 0be4fec167
commit 4f386e8c4e
8 changed files with 43 additions and 10 deletions

View file

@ -13,9 +13,13 @@ from bookwyrm import emailing, forms, models
class Report(View):
"""Make reports"""
def get(self, request, user_id, status_id=None, link_id=None):
def get(self, request, user_id=None, status_id=None, link_id=None):
"""static view of report modal"""
data = {"user": get_object_or_404(models.User, id=user_id)}
data = {"user": None}
if user_id:
# but normally we should have an error if the user is not found
data["user"] = get_object_or_404(models.User, id=user_id)
if status_id:
data["status"] = status_id
if link_id: