fix: resolve syntax error in conditional rate limiter decorator
This commit is contained in:
1 parent
fd90b6cd46
commit
79f46a221a
1 file changed
+4
-1
+4
-1
@@ -63,8 +63,11 @@ def init_auth(app, settings, limiter=None, audit_svc=None):
|
|||||||
return AdminUser(user_id)
|
return AdminUser(user_id)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def _apply_rate_limit(f):
|
||||||
|
return limiter.limit("10 per minute")(f) if limiter else f
|
||||||
|
|
||||||
@app.route('/login', methods=['GET', 'POST'])
|
@app.route('/login', methods=['GET', 'POST'])
|
||||||
@limiter.limit("10 per minute") if limiter else lambda f: f
|
@_apply_rate_limit
|
||||||
def login():
|
def login():
|
||||||
if current_user.is_authenticated:
|
if current_user.is_authenticated:
|
||||||
return redirect(url_for('overview'))
|
return redirect(url_for('overview'))
|
||||||
|
|||||||
Reference in new issue
Block a user