-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Don't allow to create subprojects with same alias #5404
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but we need to add some tests for this before merging.
@stsewd Okay. I'll add some tests and update the PR. |
@stsewd I have Added some Tests and Updated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests, but we already have some of them here https://github.com/rtfd/readthedocs.org/blob/78c34c904b347110b2cd545b4b5a80ed526590f7/readthedocs/rtd_tests/tests/test_subprojects.py#L13-L13 can you move the new tests there?
@stsewd Thanks for pointing it out. I couldn’t find the existing test case as the name is different. I'll move the tests here and update the PR. |
@stsewd Moved the tests to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some tests are already there, but the test for the alias is correct 👍
@stsewd Should I remove the tests that are already there or this can be merged? |
You can try to identify the repeated tests, but it's fine for me. |
@stsewd okay cool. |
@stsewd Removed Repeated tests. :) |
Tested this locally, it's working |
Added a
clean_alias
method in theProjectRelationshipBaseForm
which will check if the alias already exists. This will prevent Projects from Creating New subprojects with same alias.closes #5402