Fix missing import

This commit is contained in:
Khanh Ngo 2020-01-03 10:03:20 +07:00
parent 7f8ae003fc
commit e1c0b4a1b4
No known key found for this signature in database
GPG Key ID: A945965CD6351844

View File

@ -1,6 +1,7 @@
import os
import base64
import bcrypt
import traceback
import pyotp
import ldap
import ldap.filter
@ -398,28 +399,6 @@ class User(db.Model):
current_app.logger.error('Unsupported authentication method')
return False
# def get_apikeys(self, domain_name=None):
# info = []
# apikey_query = db.session.query(ApiKey) \
# .join(Domain.apikeys) \
# .outerjoin(DomainUser, Domain.id == DomainUser.domain_id) \
# .outerjoin(Account, Domain.account_id == Account.id) \
# .outerjoin(AccountUser, Account.id == AccountUser.account_id) \
# .filter(
# db.or_(
# DomainUser.user_id == User.id,
# AccountUser.user_id == User.id
# )
# ) \
# .filter(User.id == self.id)
# if domain_name:
# info = apikey_query.filter(Domain.name == domain_name).all()
# else:
# info = apikey_query.all()
# return info
def create_user(self):
"""
If user logged in successfully via LDAP in the first time