blob: e2d689931fd4228cb89fcd388dabd0ed03c75303 [file] [log] [blame]
Fatih Degirmencic2a46012019-09-30 12:07:45 +02001from functools import wraps
2from flask import flash, redirect, url_for
3from flask_login import current_user
4
5def check_confirmed(func):
6 @wraps(func)
7 def decorated_function(*args, **kwargs):
8 if not current_user.confirmed:
9 return redirect(url_for('user.unconfirmed'))
10 return func(*args, **kwargs)
11
12 return decorated_function
13
14def check_sshkey(func):
15 @wraps(func)
16 def decorated_function(*args, **kwargs):
17 if current_user.ssh_public_key is None:
18 return redirect(url_for('user.profile'))
19 return func(*args, **kwargs)
20
21 return decorated_function