django-cookie-consent icon indicating copy to clipboard operation
django-cookie-consent copied to clipboard

500 error without traceback

Open philmaweb opened this issue 5 years ago • 3 comments

Since the merge of PR #6 I was encountering problems when rendering templates. Narrowing it down showed that the usage of {% if request|cookie_consent_enabled %} as in the documentation and the test app is no longer working, the function has been renamed to is_cookie_consent_enabled - but it also uses different parameter handling.

Ended up removing the function from the template - as the check would lead to a server error. Template tag issue without stacktrace, was a headache but easily mitigated.

philmaweb avatar Feb 13 '20 12:02 philmaweb

Hi @philmaweb - are you sure that template filter is renamed - I coudn't see that change and it looks like it is still present:

https://github.com/bmihelac/django-cookie-consent/blob/master/cookie_consent/templatetags/cookie_consent_tags.py#L66-L71

Maybe it is something else that gives you error after upgrade?

bmihelac avatar Feb 14 '20 10:02 bmihelac

Curious - I can see the template filter is still called the same as you pointed out. I must have mixed up the usage of the internal is_cookie_consent_enabled and the template tag cookie_consent_enabled. Nonetheless I still got the 500 when using it in my base template. Not sure what is causing it then. Maybe my usage is incorrect or I didn't setup the models correctly? It only happens in non-debug mode btw - so when running with DEBUG = True it didn't appear.

philmaweb avatar Feb 14 '20 12:02 philmaweb

I am going through old issues to see what can be cleaned up. Does this problem still exist, and if so, have you found a way to reliably reproduce it?

sergei-maertens avatar Sep 04 '22 21:09 sergei-maertens

Due to lack of activity here, I'm closing this issue to clean up our backlog. Feel free to reopen it if you have extra information.

sergei-maertens avatar Jun 11 '23 15:06 sergei-maertens