Skip to content

Commit e8028cd

Browse files
committed
Mod : adapt to mypy constraint
1 parent edeeb25 commit e8028cd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

py/BO/User.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,13 @@ def validate_usr(
281281
"""
282282
# name & email are mandatory by DB constraints and therefore made so by pydantic model
283283
errors: List[str] = []
284-
for a_field in (User.name, User.email, User.organisation, User.country):
285-
field_name = a_field.name
286-
val = getattr(user_model, field_name)
284+
for a_field in ("name", "email", "organisation", "country"):
285+
val = getattr(user_model, a_field)
287286
if val is None:
288287
continue
289288
val = val.strip()
290289
if len(val) <= 3:
291-
errors.append("%s is too short, 3 chars minimum" % field_name)
290+
errors.append("%s is too short, 3 chars minimum" % a_field)
292291
# can check is password is strong if password not None
293292
if verify_password == True:
294293
from helpers.httpexception import DETAIL_PASSWORD_STRENGTH_ERROR

0 commit comments

Comments
 (0)