This issue occurs only on production server. Languages in settings looks like this:
`LANGUAGE_CODE = 'pl'
LANGUAGES = [
('pl', gettext('PL')),
('en', gettext('EN')),
]`
@register.simple_tag(takes_context=True)
def unsubscribe_link(context, href):
domain = 'http://' + Site.objects.get_current().domain
a = '<a href="%s" target="_self">%s</a>'
if context.get('preview'):
return a % ('#', href)
return a % (domain + context['participant'].get_unsubscribe_url(), href)
models.participant :
@models.permalink
def get_unsubscribe_url(self):
return ('participant-unsubscribe', [self.pk, self.unsubscribe_hash])
The issue is that unsubscribe_link templatetag return url in format: domain/en-us/xxx/xxx, and obviously that url response is 404. If I change "en-us" to "pl" all works fine. I can't find origin of this problem. Locally urls are generated properly.