add vars and get_user_id in model user

This commit is contained in:
Cayo Puigdefabregas 2023-05-12 12:05:41 +02:00
parent e649d65b5d
commit 3cf87f7f95
2 changed files with 9 additions and 0 deletions

View File

@ -97,3 +97,9 @@ class DevicehubConfig(Config):
MAIL_DEFAULT_SENDER = config('MAIL_DEFAULT_SENDER', '')
API_DLT = config('API_DLT', None)
API_DLT_TOKEN = config('API_DLT_TOKEN', None)
"""Definition of oauth jwt details."""
OAUTH2_JWT_ENABLED = config('OAUTH2_JWT_ENABLED', False)
OAUTH2_JWT_ISS = config('OAUTH2_JWT_ISS', '')
OAUTH2_JWT_KEY = config('OAUTH2_JWT_KEY', None)
OAUTH2_JWT_ALG = config('OAUTH2_JWT_ALG', 'HS256')

View File

@ -41,6 +41,9 @@ class User(UserMixin, Thing):
# todo set restriction that user has, at least, one active db
def get_user_id(self):
return self.id
def __init__(
self, email, password=None, inventories=None, active=True, phantom=False
) -> None: