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

Message Slug values are case-sensitive at save but case-insensitive when used in a URL #277

Open
utahguy opened this issue Apr 10, 2019 · 1 comment

Comments

@utahguy
Copy link

utahguy commented Apr 10, 2019

The system allows you to save multiple messages with the same slug if they differ in the case. This causes the server to return a 500 error when trying to display the message.

In my case, one of our marketers entered "WELCOME" for one slug and used the default "welcome" for another, and "welCOME" for a third.

I believe the expected behavior is to mark the slug field as invalid and ask the user to fix the value before saving.

Here is the stack trace -

22:24:03.371 | WEB | [pid: 677\|app: 0\|req: 354/36877] 10.0.0.18 () {46 vars in 1180 bytes} [Wed Apr 10 17:24:03 2019] GET /newsletter/news/archive/2019/4/9/WELCOME/ => generated 27 bytes in 73 msecs (HTTP/1.0 500) 7 headers in 274 bytes (1 switches on core 0)
-- | -- | --
22:24:03.371 | WEB | (self.model._meta.object_name, num)
22:24:03.371 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/db/models/query.py", line 384, in get
22:24:03.371 | WEB | newsletter.models.MultipleObjectsReturned: get() returned more than one Submission -- it returned 3!
22:24:03.369 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/views/generic/detail.py", line 53, in get_object
22:24:03.369 | WEB | self.object = self.get_object()
22:24:03.369 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/views/generic/dates.py", line 682, in get_object
22:24:03.369 | WEB | return super(BaseDetailView, self).get_object(queryset=qs)
22:24:03.369 | WEB | obj = queryset.get()
22:24:03.368 | WEB | File "/virtualenv/lib/python3.6/site-packages/newsletter/views.py", line 155, in dispatch
22:24:03.368 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
22:24:03.368 | WEB | return handler(request, *args, **kwargs)
22:24:03.368 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/views/generic/detail.py", line 115, in get
22:24:03.368 | WEB | return self.dispatch(request, *args, **kwargs)
22:24:03.368 | WEB | response = wrapped_callback(request, *callback_args, **callback_kwargs)
22:24:03.368 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
22:24:03.368 | WEB | return super(ProcessUrlDataMixin, self).dispatch(*args, **kwargs)
22:24:03.367 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
22:24:03.367 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
22:24:03.367 | WEB | response = self._get_response(request)
22:24:03.367 | WEB | response = self.process_exception_by_middleware(e, request)
22:24:03.365 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
22:24:03.365 | WEB | response = get_response(request)
22:24:03.365 | WEB | File "/virtualenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
22:24:03.365 | WEB | Traceback (most recent call last):
22:24:03.365 | WEB | Internal Server Error: /newsletter/news/archive/2019/4/9/WELCOME/
@woodz-
Copy link

woodz- commented Sep 1, 2019

In my experience this repo is for enthusiasts. Pull requests having coverage maintained are welcome.

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

No branches or pull requests

2 participants