forked from MarseyWorld/MarseyWorld
fixed a bug that caused 500 errors when jannies left the input area for days empty when they chudded someone
also removed some useless code for checking admin status on alts (why did I add this)master
parent
e5dbc9bfdd
commit
de539ab7e5
|
@ -932,18 +932,16 @@ def admin_removed_comments(v):
|
|||
def agendaposter(user_id, v):
|
||||
user = g.db.query(User).filter_by(id=user_id).one_or_none()
|
||||
|
||||
days = min(float(request.values.get("days", 30.0)), 30.0)
|
||||
days = request.values.get("days")
|
||||
if not days: days = 30.0
|
||||
days = float(days)
|
||||
days = min(days, 30.0)
|
||||
|
||||
expiry = int(time.time() + days*60*60*24)
|
||||
|
||||
user.agendaposter = expiry
|
||||
g.db.add(user)
|
||||
|
||||
for alt in user.alts:
|
||||
if alt.admin_level: return {"error": "User is an admin!"}
|
||||
alt.agendaposter = expiry
|
||||
g.db.add(alt)
|
||||
|
||||
note = f"for {days} days"
|
||||
|
||||
ma = ModAction(
|
||||
|
|
Loading…
Reference in New Issue