Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniqueness for user projects in DB #143

Closed
IzzySmillie opened this issue Mar 3, 2023 · 1 comment · Fixed by #156
Closed

Uniqueness for user projects in DB #143

IzzySmillie opened this issue Mar 3, 2023 · 1 comment · Fixed by #156
Assignees

Comments

@IzzySmillie
Copy link
Contributor

IzzySmillie commented Mar 3, 2023


  • Make sure projects can't be saved in the DB with the same identifier as a starter project
  • Checking project can have the same identifier with a different language
  • Combination of language and identifier is unique

So to clarify:
Projects can have the same identifier with a different language

identifier locale
hello-world-example en
hello-world-example fr-FR

A user cannot create a project with the same identifier that is already in the DB (there should already be a check for this)
E.G user cannot have identifier hello-world-example

The combination of identifier and lang should be unique. Cannot have the same identifier with the same lang

This is not allowed

identifier locale
hello-world-example en
hello-world-example en
@loiswells97 loiswells97 self-assigned this Mar 6, 2023
@create-issue-branch
Copy link
Contributor

Branch issues/143-Uniqueness_for_user_projects_in_DB created!

create-issue-branch bot pushed a commit that referenced this issue Mar 6, 2023
loiswells97 added a commit that referenced this issue Mar 9, 2023
# What's Changed?

- Added `project` model validations to ensure only one user can own
projects with a given identifier and that RPF projects have a locale
- Slight `PhraseGenerator` refactor to ensure phrases generated are
always unique
- Ensure remix generates its own identifier and sets `locale` to `nil`

closes #143

---------

Co-authored-by: loiswells97 <loiswells97@users.noreply.github.com>
Co-authored-by: Lois Wells <88904316+loiswells97@users.noreply.github.com>
Co-authored-by: Lois Wells <lois.wells@raspberrypi.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants