Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# Accept?
accept: bool = True
+ # Comment (optional)
+ comment: str = ""
+
class Comment(pydantic.BaseModel):
# Comment
if not await report.has_perm(user, accept=data.accept):
raise fastapi.HTTPError(403, "You don't have permission to change this report")
+ # Post the comment if one has been sent
+ if data.comment:
+ await report.comment(
+ comment = data.comment,
+ reporter = user,
+ )
+
# Close the report
await report.close(
closed_by = user,