Skip to content

Commit

Permalink
hide user information for admins
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Dec 13, 2023
1 parent 9783755 commit 59ad5ad
Showing 1 changed file with 40 additions and 33 deletions.
73 changes: 40 additions & 33 deletions frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,39 +368,42 @@ def asset_to_tiles(asset):
"config": {"fade_time": 0.5},
}
)
tiles.append(
{
"type": "flat",
"asset": "flat.png",
"x1": 0,
"y1": 1040,
"x2": 1920,
"y2": 1080,
"config": {"color": "#000000", "alpha": 230, "fade_time": 0.5},
}
)
tiles.append(
{
"type": "markup",
"asset": "default-font.ttf",
"x1": 150,
"y1": 1048,
"x2": 1900,
"y2": 1080,
"config": {
"font_size": 25,
"fade_time": 0.5,
"text": "Project by @{user} - visit {url} to share your own.".format(
user=asset["userdata"]["user"],
url=url_for(
"index",
_external=True,
if asset["userdata"]["user"].lower() not in app.config.get(
"ADMIN_USERS", set()
):
tiles.append(
{
"type": "flat",
"asset": "flat.png",
"x1": 0,
"y1": 1040,
"x2": 1920,
"y2": 1080,
"config": {"color": "#000000", "alpha": 230, "fade_time": 0.5},
}
)
tiles.append(
{
"type": "markup",
"asset": "default-font.ttf",
"x1": 150,
"y1": 1048,
"x2": 1900,
"y2": 1080,
"config": {
"font_size": 25,
"fade_time": 0.5,
"text": "Project by @{user} - visit {url} to share your own.".format(
user=asset["userdata"]["user"],
url=url_for(
"index",
_external=True,
),
),
),
"color": "#dddddd",
},
}
)
"color": "#dddddd",
},
}
)
if "EXTRA_ASSETS" in app.config:
tiles.extend(app.config["EXTRA_ASSETS"])
return tiles
Expand Down Expand Up @@ -538,7 +541,11 @@ def content_request_review(asset_id):

if g.user.lower() in app.config.get("ADMIN_USERS", set()):
update_asset_userdata(asset, state="confirmed")
app.logger.warn('auto-confirming {} because it was uploaded by admin {}'.format(asset['id'], g.user))
app.logger.warn(
"auto-confirming {} because it was uploaded by admin {}".format(
asset["id"], g.user
)
)
return jsonify(ok=True)

moderation_url = url_for(
Expand Down

0 comments on commit 59ad5ad

Please sign in to comment.