Bug fixes
- Change song select mouse wheel song scrolling to be instant - Clicking on don chan in account settings toggles the animation - If the music is too long for the chart, the results screen is shown earlier - Fix weird BPM values freezing the browser (zero, negative, and very large) - Add a warning to the page when JavaScript is disabled in the browser - Fix Chrome auto dark mode by forcing light mode on the page - Add a meta keywords tag to the page - Fix plugin names getting cut off in the menu - Delay the function editing of the EditFunction class in plugins to the start() function instead of load() - When stopping one of the plugins, all the plugins have to be stopped in reverse order and started again so that patched code of a stopped plugin does not linger around - Fix importing plugins that have a SyntaxError - Fix plugins getting the same internal name when added without one, causing them to not appear in the plugin settings - Support editing args in EditFunction for plugins - Prevent multiple websockets from being opened - Fix page freezing after selecting Random song with no songs - Fix the back button being repeated twice when there are no songs - Fix /admin/users not accepting case insensitive usernames - Pressing enter on the Delete Account field does the expected action instead of refreshing the page - Better error message when custom folder access is denied - Fix being able to start netplay in custom songs after refreshing the page (#383) - Fix an error when importing songs from previous session and clicking on the white spot where you normally start multiplayer session - Fix canvas elements becoming smaller than 1x1 resolution and crashing the game (#390) - Fix song frame shadow cache on song select not being cleared when resizing the browser window, causing it to become blurry - Fix a pause-restart error when you hit both confirm keys on the restart button
This commit is contained in:
11
app.py
11
app.py
@@ -371,12 +371,15 @@ def route_admin_users_post():
|
||||
max_level = admin['user_level'] - 1
|
||||
|
||||
username = request.form.get('username')
|
||||
level = int(request.form.get('level')) or 0
|
||||
try:
|
||||
level = int(request.form.get('level')) or 0
|
||||
except ValueError:
|
||||
level = 0
|
||||
|
||||
user = db.users.find_one({'username': username})
|
||||
user = db.users.find_one({'username_lower': username.lower()})
|
||||
if not user:
|
||||
flash('Error: User was not found.')
|
||||
elif admin_name == username:
|
||||
elif admin['username'] == user['username']:
|
||||
flash('Error: You cannot modify your own level.')
|
||||
else:
|
||||
user_level = user['user_level']
|
||||
@@ -386,7 +389,7 @@ def route_admin_users_post():
|
||||
flash('Error: This user has higher level than you.')
|
||||
else:
|
||||
output = {'user_level': level}
|
||||
db.users.update_one({'username': username}, {'$set': output})
|
||||
db.users.update_one({'username': user['username']}, {'$set': output})
|
||||
flash('User updated.')
|
||||
|
||||
return render_template('admin_users.html', config=get_config(), max_level=max_level, username=username, level=level)
|
||||
|
||||
Reference in New Issue
Block a user