default username to service_id to ensure we have one otherwise a blank string is not a unique username
This commit is contained in:
parent
31f403207d
commit
3790a15465
|
@ -19,9 +19,9 @@ class UserService:
|
|||
self,
|
||||
service: str,
|
||||
service_id: str,
|
||||
name: Optional[str] = None,
|
||||
username: Optional[str] = None,
|
||||
email: Optional[str] = None,
|
||||
name: Optional[str] = "",
|
||||
username: Optional[str] = "",
|
||||
email: Optional[str] = "",
|
||||
) -> UserModel:
|
||||
"""Create_user."""
|
||||
user_model: Optional[UserModel] = (
|
||||
|
@ -30,12 +30,8 @@ class UserService:
|
|||
.first()
|
||||
)
|
||||
if user_model is None:
|
||||
if name is None:
|
||||
name = ""
|
||||
if username is None:
|
||||
username = ""
|
||||
if email is None:
|
||||
email = ""
|
||||
if username == "":
|
||||
username = service_id
|
||||
|
||||
user_model = UserModel(
|
||||
username=username,
|
||||
|
|
Loading…
Reference in New Issue