Closed
Bug 1330357
Opened 9 years ago
Closed 9 years ago
ISE if profile interest tag is not lowercase in the database
Categories
(developer.mozilla.org Graveyard :: Profiles, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jwhitlock, Assigned: jwhitlock)
References
Details
(Whiteboard: [specification][type:bug])
What did you do?
================
1. Add / change a taggit Tag to use uppercase in the name, such as Tag profile:interest:php to profile:interest:PHP
2. Edit user profile, add PHP as an interest
What happened?
==============
An Internal Server Error is returned, and the user's interest section is empty
What should have happened?
==========================
"PHP", "php", or "pHp" should all select "profile:interest:PHP" as the interest tag without an ISE
Is there anything else we should know?
======================================
A unique index was recently added to production, with bug 1293749. The code for profile interests may need to be updated for case-insensitive matching of tags, but the behavior should be the same in the dev and production environments now.
| Assignee | ||
Comment 1•9 years ago
|
||
Tracked in Sentry as https://sentry.prod.mozaws.net/operations/mdn-prod/issues/377710/. Traceback:
IntegrityError: (1062, "Duplicate entry 'profile:interest:php' for key 'name'")
File "django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "newrelic/hooks/framework_django.py", line 499, in wrapper
return wrapped(*args, **kwargs)
File "kuma/users/views.py", line 433, in user_edit
new_user.tags.set_ns(tag_ns, *tags)
File "taggit/utils.py", line 139, in inner
return func(self, *args, **kwargs)
File "kuma/core/managers.py", line 106, in set_ns
self.add_ns(namespace, *tags)
File "taggit/utils.py", line 139, in inner
return func(self, *args, **kwargs)
File "kuma/core/managers.py", line 87, in add_ns
super(_NamespacedTaggableManager, self).add(*ns_tags)
File "taggit/utils.py", line 139, in inner
return func(self, *args, **kwargs)
File "taggit/managers.py", line 192, in add
tag_objs.add(self.through.tag_model().objects.create(name=new_tag))
File "django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "django/db/models/query.py", line 348, in create
obj.save(force_insert=True, using=self.db)
File "taggit/models.py", line 86, in save
return super(TagBase, self).save(*args, **kwargs)
File "django/db/models/base.py", line 734, in save
force_update=force_update, update_fields=update_fields)
File "django/db/models/base.py", line 762, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "django/db/models/base.py", line 846, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "django/db/models/base.py", line 885, in _do_insert
using=using, raw=raw)
File "django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "django/db/models/query.py", line 920, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "django/db/models/sql/compiler.py", line 974, in execute_sql
cursor.execute(sql, params)
File "django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "django/db/utils.py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "newrelic/hooks/database_dbapi2.py", line 22, in execute
*args, **kwargs)
File "MySQLdb/cursors.py", line 226, in execute
self.errorhandler(self, exc, value)
File "MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorvalue
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jwhitlock
Comment 2•9 years ago
|
||
Commits pushed to master at https://github.com/mozilla/kuma
https://github.com/mozilla/kuma/commit/115b4d2bb434b7f79fa9920351ddf59b55592041
bug 1330357: Test duplicate profile tags
Test bug 1330357, where Kuma code lowercases profile tags and tries to
add a tag that collides with the mixed case tag.
https://github.com/mozilla/kuma/commit/1d0f3030e6f7dd534a9a89f091418f71ac9ff085
bug 1330357: Allow mixed case interest tags
https://github.com/mozilla/kuma/commit/0f972a3e54c249211a449875302ac23878e99651
Merge pull request #4103 from jwhitlock/taggit_ci_1331643
bug 1331643, 1330357: Avoid duplicate tags with TAGGIT_CASE_INSENSITIVE=True
| Assignee | ||
Comment 3•9 years ago
|
||
Pushed to stage and production, confirmed that mixed case interests are allowed.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•