marsey -> emoji

master
Aevann 2023-03-18 16:39:26 +02:00
parent ba4bf8a112
commit 665bd82437
2 changed files with 9 additions and 9 deletions

View File

@ -433,7 +433,7 @@ PERMS = { # Minimum admin_level to perform action.
'USER_BLOCKS_VISIBLE': 0,
'USER_FOLLOWS_VISIBLE': 0,
'USER_VOTERS_VISIBLE': 0,
'VIEW_PENDING_SUBMITTED_MARSEYS': 0,
'VIEW_PENDING_SUBMITTED_EMOJIS': 0,
'POST_COMMENT_DISTINGUISH': 1,
'POST_BYPASS_REPOST_CHECKING': 1,

View File

@ -19,18 +19,18 @@ ASSET_TYPES = (Emoji, HatDef)
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
@auth_required
def submit_emojis(v:User):
if v.admin_level >= PERMS['VIEW_PENDING_SUBMITTED_MARSEYS']:
marseys = g.db.query(Emoji).filter(Emoji.submitter_id != None)
if v.admin_level >= PERMS['VIEW_PENDING_SUBMITTED_EMOJIS']:
emojis = g.db.query(Emoji).filter(Emoji.submitter_id != None)
else:
marseys = g.db.query(Emoji).filter(Emoji.submitter_id == v.id)
emojis = g.db.query(Emoji).filter(Emoji.submitter_id == v.id)
marseys = marseys.order_by(Emoji.created_utc.desc()).all()
emojis = emojis.order_by(Emoji.created_utc.desc()).all()
for marsey in marseys:
marsey.author = g.db.query(User.username).filter_by(id=marsey.author_id).one()[0]
marsey.submitter = g.db.query(User.username).filter_by(id=marsey.submitter_id).one()[0]
for emoji in emojis:
emoji.author = g.db.query(User.username).filter_by(id=emoji.author_id).one()[0]
emoji.submitter = g.db.query(User.username).filter_by(id=emoji.submitter_id).one()[0]
return render_template("submit_emojis.html", v=v, marseys=marseys, kinds=EMOJIS_KINDS, msg=get_msg(), error=get_error())
return render_template("submit_emojis.html", v=v, emojis=emojis, kinds=EMOJIS_KINDS, msg=get_msg(), error=get_error())
@app.post("/submit/emojis")