-
Notifications
You must be signed in to change notification settings - Fork 1k
Constraint on normalized organization names #17998
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
I think the |
Oh, no, this is also keeping a record of previous organization names that have since been changed. |
Marking as blocked for merging until we manually clean up the duplicate orgs currently in the DB. |
@@ -538,6 +540,10 @@ class OrganizationApplication(OrganizationMixin, HasObservations, db.Model): | |||
__tablename__ = "organization_applications" | |||
__repr__ = make_repr("name") | |||
|
|||
@declared_attr |
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.
did a giant double take wondering how
warehouse/warehouse/admin/views/organizations.py
Lines 362 to 371 in 1938535
conflicting_applications = ( | |
request.db.query(OrganizationApplication) | |
.filter( | |
OrganizationApplication.normalized_name | |
== organization_application.normalized_name | |
) | |
.filter(OrganizationApplication.id != organization_application.id) | |
.order_by(OrganizationApplication.submitted) | |
.all() | |
) |
No description provided.