Coverage for modules/box__default/auth/decorators.py: 62%

# Coverage for modules/box__default/auth/decorators.py : 62%

## 11 statements

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 from functools import wraps

2

3 from flask import redirect

4 from flask import url_for

5 from flask_login import current_user

6

7

8 def check_confirmed(func):

9 @wraps(func)

10 def decorated_function(*args, **kwargs):

11 if current_user.is_email_confirmed:

12 return func(*args, **kwargs)

13 return redirect(url_for("auth.unconfirmed"))

14

15 return decorated_function