remove unused import
This commit is contained in:
parent
851956f715
commit
bc4f63da45
|
@ -107,7 +107,7 @@ def can_remove_domain(f):
|
|||
|
||||
if Setting().get('per_user_permissions'):
|
||||
userperms = UserPermissions.query.filter(UserPermissions.user_id == current_user.id).first()
|
||||
if userperms.remove_domain:
|
||||
if userperms and userperms.remove_domain:
|
||||
return f(*args, **kwargs)
|
||||
|
||||
abort(403)
|
||||
|
@ -132,7 +132,7 @@ def can_create_domain(f):
|
|||
|
||||
if Setting().get('per_user_permissions'):
|
||||
userperms = UserPermissions.query.filter(UserPermissions.user_id == current_user.id).first()
|
||||
if userperms.create_domain:
|
||||
if userperms and userperms.create_domain:
|
||||
return f(*args, **kwargs)
|
||||
|
||||
abort(403)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from .base import db
|
||||
from flask import current_app
|
||||
|
||||
class UserPermissions(db.Model):
|
||||
__tablename__ = 'user_permissions'
|
||||
|
|
Loading…
Reference in a new issue