Re: pglister: bug: Can't add moderators (and create lists)

From: Célestin Matte <celestin(dot)matte(at)cmatte(dot)me>
To: pgsql-www(at)lists(dot)postgresql(dot)org
Subject: Re: pglister: bug: Can't add moderators (and create lists)
Date: 2021-09-21 10:01:02
Message-ID: ebc45d80-4242-efc8-2951-05eae3a2d741@cmatte.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

> For example, for my local pglister installation I have a mapping for
> static files of:
> /media/admin ->
> /home/mha/django/django22-py3/lib/python3.7/site-packages/django/contrib/admin/static/admin
>
> (this being in my virtualenv that holds the django installation)

Oh, so these files are all shipped with django. Thanks, that solves the issue


>> Unrelated issue I encountered when debugging: when activating logging in django, the log file get spammed with exceptions every time django is hitting a {%if somevariable %} syntax, even though that's the correct django way to test variable existence [1]. Any idea what could be causing that?
>> [1] https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#if
>
> That's strange. I don't see any of that. Exactly what does the
> exception look like?
>

Example on the main page, with a DEBUG-level logger activated:
Exception while resolving variable 'title' in template 'home.html'.
Traceback (most recent call last):
File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 829, in _resolve_lookup
current = current[bit]
File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/context.py", line 83, in __getitem__
raise KeyError(key)
KeyError: 'title'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 835, in _resolve_lookup
if isinstance(current, BaseContext) and getattr(type(current), bit):
AttributeError: type object 'RequestContext' has no attribute 'title'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 843, in _resolve_lookup
current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'title'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 850, in _resolve_lookup
(bit, current)) # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [title] in [{'True': True, 'False': False, 'None': None}, {'csrf_token': <SimpleLazyObject: <function csrf.<locals>._get_val at 0x7fa5737bdea0>>, 'request': <WSGIRequest: GET '/'>, 'user': <SimpleLazyObject: <function AuthenticationMiddleware.process_request.<locals>.<lambda> at 0x7fa573832488>>, 'perms': <django.contrib.auth.context_processors.PermWrapper object at 0x7fa5737fc518>, 'messages': <django.contrib.messages.storage.fallback.FallbackStorage object at 0x7fa573800a58>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40}}, {}, {'view': <pglister.lists.views.Home object at 0x7fa573800b70>}]

This line triggering this is in templates/base.html:
<title>{%if title%}{{title}} - {%endif%}PostgreSQL mailing lists</title>

--
Célestin Matte

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Jonathan S. Katz 2021-09-21 14:49:15 Re: Add AIX on the PostgreSQL Download page
Previous Message REIX, Tony 2021-09-21 08:04:15 RE: Add AIX on the PostgreSQL Download page