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-20 16:15:45
Message-ID: ff080c17-7f96-e54c-7496-e9d92882107f@cmatte.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

Hello,

>> In the interface (in /admin/lists/list/1/change/), I cannot create a list because the "Moderators" field is always empty, and django won't let me create a list without moderators.
>
> The reason the moderators field is mandatory, is that it's what's used
> to populate the list ownership alias. I think there may have been
> other reasons as well, see the commit message in 78dc0eea, but I don't
> recall exactly what they are. But that is definitely one reason for it
> being there now, so we can't remove that.
>
> You should be able to add any Subscriber as a moderator, they don't
> have to be a member of the particular list. The Subscriber entry is
> created the first time the user logged in, see
> web/pglister/lists/migration.py. Did you somehow manage to log in
> without this happening?

It turns out the issue was not in Django, but client-side: JS files for admin were missing, so the moderator field was not filled.
I already noticed that CSS files were missing from /admin/, and made a PR back then: https://gitlab.com/pglister/pglister/-/merge_requests/24 (Should I rather make PRs on gitlab or send patches on this list?)
Are CSS, JS and font files supposed to be somehow generated, or should I make a patch adding them all manually?

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

--
Célestin Matte

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Magnus Hagander 2021-09-21 07:02:03 Re: pglister: bug: Can't add moderators (and create lists)
Previous Message Magnus Hagander 2021-09-20 12:02:49 Re: pglister: bug: Can't add moderators (and create lists)