File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments