remove unused import

This commit is contained in:
Steffen Schwebel 2021-06-10 14:51:42 +02:00
parent 851956f715
commit bc4f63da45
2 changed files with 2 additions and 3 deletions

View file

@ -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)

View file

@ -1,5 +1,4 @@
from .base import db
from flask import current_app
class UserPermissions(db.Model):
__tablename__ = 'user_permissions'