feat(api): include smtp flag in login response (#114)

This commit is contained in:
Kraiem Taha Yassine 2021-08-04 17:09:55 +02:00 committed by GitHub
parent 3a6be97ec5
commit a17ccde979
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -58,6 +58,7 @@ def login():
'data': {
"user": r,
"client": c,
"smtp": helper.has_smtp()
}
}
@ -74,7 +75,7 @@ def get_account(context):
"metadata": metadata.get_remaining_metadata_with_count(context['tenantId'])
},
**license.get_status(context["tenantId"]),
"smtp": environ["EMAIL_HOST"] is not None and len(environ["EMAIL_HOST"]) > 0
"smtp": helper.has_smtp()
}
}

View file

@ -363,3 +363,7 @@ def get_internal_project_id(project_id64):
return None
project_id = int(project_id64)
return project_id
def has_smtp():
return environ["EMAIL_HOST"] is not None and len(environ["EMAIL_HOST"]) > 0