mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 14:10:00 +00:00
make admin unable to set own user class, fix missing post method
This commit is contained in:
parent
931b2b0b83
commit
04047a5712
|
@ -206,14 +206,14 @@ def home(rss):
|
|||
rss_filter=rss_query_string)
|
||||
|
||||
|
||||
@app.route('/user/<user_name>')
|
||||
@app.route('/user/<user_name>', methods=['GET', 'POST'])
|
||||
def view_user(user_name):
|
||||
user = models.User.by_username(user_name)
|
||||
|
||||
if not user:
|
||||
flask.abort(404)
|
||||
|
||||
if flask.g.user:
|
||||
if flask.g.user and flask.g.user.id != user.id:
|
||||
admin = flask.g.user.is_admin
|
||||
superadmin = flask.g.user.is_superadmin
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue