Skip to content

Commit

Permalink
use username in places where user will see it
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Dec 23, 2024
1 parent a55ab78 commit 12a02e0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,23 +398,23 @@ def content_request_review(asset_id):
return error("Cannot review")

moderation_message = "{asset} uploaded by {user}. ".format(
user=g.userid,
user=g.username,
asset=asset["filetype"].capitalize(),
)

if g.user_is_admin:
update_asset_userdata(asset, state=State.CONFIRMED, moderated_by=g.userid)
update_asset_userdata(asset, state=State.CONFIRMED, moderated_by=g.username)
app.logger.warn(
"auto-confirming {} because it was uploaded by admin {}".format(
asset["id"], g.userid
asset["id"], g.username
)
)
moderation_message += "It was automatically confirmed because user is an admin."
elif g.user_without_limits:
update_asset_userdata(asset, state=State.CONFIRMED, moderated_by=g.userid)
update_asset_userdata(asset, state=State.CONFIRMED, moderated_by=g.username)
app.logger.warn(
"auto-confirming {} because it was uploaded by no-limits user {}".format(
asset["id"], g.userid
asset["id"], g.username
)
)
moderation_message += (
Expand Down Expand Up @@ -477,10 +477,10 @@ def content_moderate_result(asset_id, result):

if result == "confirm":
app.logger.info("Asset {} was confirmed".format(asset["id"]))
update_asset_userdata(asset, state=State.CONFIRMED, moderated_by=g.userid)
update_asset_userdata(asset, state=State.CONFIRMED, moderated_by=g.username)
else:
app.logger.info("Asset {} was rejected".format(asset["id"]))
update_asset_userdata(asset, state=State.REJECTED, moderated_by=g.userid)
update_asset_userdata(asset, state=State.REJECTED, moderated_by=g.username

return jsonify(ok=True)

Expand Down

0 comments on commit 12a02e0

Please sign in to comment.