hngprojects / hng_boilerplate_python_fastapi_web

Apache License 2.0
153 stars 136 forks source link

fix: fixed organization name duplication after user registration #856

Closed johnson-oragui closed 2 months ago

johnson-oragui commented 2 months ago

This fix currently fixes the error thrown when two different users has the same first name and trying to register. ​

Description

This fix currently fixes the error thrown when two different users has the same first name and trying to register. The first user would get registered successfully and an organization created for the user, but the second user with the same first name would have an account created, but no organization created because of organization name duplication, as the first name of users are used to create an organization for them on sign up. This fix solves that issue by using the user's email address as the organization name, that way every organization name would be unique as the user email is unique.

Related Issue (Link to issue ticket)

[]()

Motivation and Context

This fix solves the issue of organization name duplication on user creation. ​

How Has This Been Tested?

Screenshots (if any)

registering first user with same firstname organization fix1

registering second user with same firstname organization fix2

Types of changes

Checklist:

Please let me know if there is any change i need to make. thank you.