amy: Bulk import workflow encounters IntegrityError when saving an organization
Currently, we allow organizations with the domain that contains the www
subdomain. For eg: Google can exist as www.google.com
as well as google.com
, leading to IntegrityError
while saving the first while the second exists.
Shouldn’t we enforce one URL pattern and trim/add www
to the domain
field when saving an organization?
Testcase:
In [5]: Organization.objects.create(fullname='Google', domain='google.com')
Out[5]: <Organization: google.com>
In [6]: Organization.objects.create(fullname='Google', domain='www.google.com')
---------------------------------------------------------------------------
IntegrityError Traceback (most recent call last)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 27 (14 by maintainers)
Commits related to this issue
- Rewrite the query to fetch an organization. Prevents IntegrityError while trying to save an organization with conflicting fullname but different domains. Fixes #964 — committed to aditnryn/amy by aditnryn 8 years ago
- Rewrite the query to fetch an organization. Prevents IntegrityError while trying to save an organization with conflicting fullname but different domains. Fixes #964 — committed to aditnryn/amy by aditnryn 8 years ago
Does it solve the issue? If no, why?
-1 - I’ve seen a number of places that serve content only with
www.
subdomain… Essentially,www.domain.tld
!=domain.tld
.