Fix some mod log errors and make it more durable to future changes.

This commit is contained in:
Ben Rog-Wilhelm 2022-08-27 07:08:20 -05:00 committed by Ben Rog-Wilhelm
parent 74a21234b5
commit de4d923b32
2 changed files with 45 additions and 15 deletions

View file

@ -9,6 +9,7 @@ import calendar
import matplotlib.pyplot as plt
from files.classes.mod_logs import ACTIONTYPES, ACTIONTYPES2
from files.classes.badges import BadgeDef
import logging
@app.get('/logged_out/')
@app.get('/logged_out/<path:old>')
@ -224,8 +225,13 @@ def log(v):
kind = request.values.get("kind")
if v and v.admin_level > 1: types = ACTIONTYPES
else: types = ACTIONTYPES2
if kind not in ACTIONTYPES:
logging.warning(f'Unfamiliar ACTIONTYPE {kind}')
if v and v.admin_level > 1:
types = ACTIONTYPES
else:
types = ACTIONTYPES2
if kind not in types: kind = None