jazzband / django-newsletter

An email newsletter application for the Django web application framework, including an extended admin interface, web (un)subscription, dynamic e-mail templates, an archive and HTML email support.
GNU Affero General Public License v3.0
850 stars 206 forks source link

Message 'Save As' NoReverseMatch #322

Closed rjperez94 closed 4 years ago

rjperez94 commented 4 years ago

NoReverseMatch at /admin/newsletter/message/1/change/ Reverse for 'newsletter_message_preview' with arguments '('',)' not found. 1 pattern(s) tried: ['admin/newsletter/message/(.+)/preview/$']

Request Method: POST Request URL: http://127.0.0.1:8000/admin/newsletter/message/1/change/ Django Version: 2.2.12 Exception Type: NoReverseMatch Exception Value: Reverse for 'newsletter_message_preview' with arguments '('',)' not found. 1 pattern(s) tried: ['admin/newsletter/message/(.+)/preview/$'] Exception Location: C:\Program Files\Python37\lib\site-packages\django\urls\resolvers.py in _reverse_with_prefix, line 673 Python Version: C:\Program Files\Python37\python.exe Python Version: 3.7.6

INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'newsletter', ]

This project of mine is from the tutorial project on the Django site

frennkie commented 4 years ago

The same problem happens in the Submission admin:

django.urls.exceptions.NoReverseMatch: Reverse for 'newsletter_submission_submit' with arguments '('',)' not found. 1 pattern(s) tried: ['admin\\/newsletter\\/submission\\/(.+)/submit/$']

This problem is triggered when there is no new object (e.g. because of a validation error). The template then tries to lookup a link (either preview for Message or submit for Subscription and fails.