Skip to content

Commit

Permalink
Merge pull request #357 from DNO-inc/improve_auth_logs
Browse files Browse the repository at this point in the history
register user with invalid group
  • Loading branch information
m-o-d-e-r authored Jun 4, 2024
2 parents 7f532dc + aab787b commit 0e73ef1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions burrito/utils/users_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ def create_user_with_cabinet(
tmp_user_login = transliterate(f"{firstname} {cabinet_id}")

#TODO: tmp solution, i hope. Assign a `global' faculty to the user if it fails to create
for i in range(2):
for i in range(3):
try:
user: Users = Users.create(
cabinet_id=cabinet_id,
firstname=firstname,
lastname=lastname,
login=tmp_user_login,
faculty=faculty if not i else 1,
group=group,
group=group if i != 2 else None,
email=email,
role=role_object
)
Expand All @@ -92,6 +92,8 @@ def create_user_with_cabinet(
get_logger().error(e)
get_logger().warning(
f"""
Firstname {firstname}
Lastname {lastname}
Email {email}
Login {tmp_user_login}
Faculty {faculty}
Expand Down

0 comments on commit 0e73ef1

Please sign in to comment.