adds new endpoint for active users

This commit is contained in:
msramalho
2024-10-29 10:56:44 +00:00
parent 47cb250a12
commit 17105ffa66
5 changed files with 43 additions and 6 deletions

View File

@@ -104,6 +104,9 @@ def create_tag(db: Session, tag: str):
db.refresh(db_tag)
return db_tag
def is_active_user(db: Session, email: str) -> bool:
email = email.lower()
return len(email) and db.query(models.User).filter(models.User.email == email).count() > 0
def is_user_in_group(db: Session, group_name: str, email: str) -> models.Group:
if email == ALLOW_ANY_EMAIL: return True