master
Aevann1 2021-09-11 05:18:46 +02:00
parent 71f846825f
commit dfb858cab1
2 changed files with 8 additions and 8 deletions

View File

@ -26,7 +26,7 @@ IMGUR_KEY = environ.get("IMGUR_KEY", "").strip()
@app.post("/@<username>/revert_actions")
@admin_level_required(6)
def revert_actions(v, username):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
user = get_user(username)
if not user: abort(404)
@ -47,7 +47,7 @@ def revert_actions(v, username):
@app.post("/@<username>/make_admin")
@admin_level_required(6)
def make_admin(v, username):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
user = get_user(username)
if not user: abort(404)
user.admin_level = 6
@ -58,7 +58,7 @@ def make_admin(v, username):
@app.post("/@<username>/remove_admin")
@admin_level_required(6)
def remove_admin(v, username):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
user = get_user(username)
if not user: abort(404)
user.admin_level = 0
@ -69,7 +69,7 @@ def remove_admin(v, username):
@app.post("/@<username>/make_fake_admin")
@admin_level_required(6)
def make_fake_admin(v, username):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
user = get_user(username)
if not user: abort(404)
user.admin_level = 1
@ -80,7 +80,7 @@ def make_fake_admin(v, username):
@app.post("/@<username>/remove_fake_admin")
@admin_level_required(6)
def remove_fake_admin(v, username):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
user = get_user(username)
if not user: abort(404)
user.admin_level = 0
@ -92,7 +92,7 @@ def remove_fake_admin(v, username):
@limiter.limit("1/day")
@admin_level_required(6)
def monthly(v):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
_awards = []
for u in g.db.query(User).filter(User.patron > 0).all():

View File

@ -201,7 +201,7 @@
{% endif %}
{% endif %}
{% if 'rdrama' in request.host and v.id in [12,28,29,747,995] %}
{% if 'rdrama' in request.host and v.id in [1,12,28,29,747,995] %}
{% if u.admin_level == 0 %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/make_admin')">Make admin</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/make_fake_admin')">Make fake admin</a>
@ -468,7 +468,7 @@
{% endif %}
{% endif %}
{% if 'rdrama' in request.host and v.id in [12,28,29,747,995] %}
{% if 'rdrama' in request.host and v.id in [1,12,28,29,747,995] %}
{% if u.admin_level == 0 %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/make_admin')">Make admin</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/make_fake_admin')">Make fake admin</a>