Re: commitfest app returning error 500

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: PostgreSQL WWW <pgsql-www(at)lists(dot)postgresql(dot)org>
Subject: Re: commitfest app returning error 500
Date: 2020-09-11 12:35:31
Message-ID: CABUevEwQyDkgrUhq1rUcoHf6KUdupeRPxJTc-cYJAQ4kMz7rYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Fri, Sep 11, 2020 at 12:48 AM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
wrote:

> I just edited user 'alvarofherrera' in commitfest.pg.org to remove the
> 'active' flag, because that's some ancient test community account of
> mine that somebody seems to have activated in commitfest. However,
> after doing that, the 'edit' interface of the patches that involve that
> user now returns error 500:
>
> https://commitfest.postgresql.org/29/2690/edit/
> https://commitfest.postgresql.org/29/2673/edit/
>
> I'm not familiar enough with Django to fix this ...
>
> Of course, a workaround is to mark the user active, but since the
> patches are both committed I don't think it's necessary.
>

First rule of distributed authentication systems is NEVER EVER edit the
users on "downstream" systems. If you want to disable a user you have to do
it on the *primary* system. Same for editing any other attribute on it.
(Yes, we should probably not allow editing of it. In fact we don't in
general -- except you are a superuser so you can bypass the rules)

We can always discuss how to fix it properly, but randomly editing an
object that should not be edited is not the way.

Also, next time you edit something and *see* that it breaks, please undo
that breakage. Instead of leaving it around flooding us with crash reports
:P

As for the core problem, well, consider it from the db side. The query does
an LEFT JOIN against the user information (closest analogy since you didn't
actually delete the data, you just edited the active flag). You just
removed the user information. Then the row disappears from the output,
which leaves us with a NULL and that's why it breaks. What would you
want/expect to happen then? Just remove the reference to the user? If so,
why not just do that in the first place?

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Browse pgsql-www by date

  From Date Subject
Next Message Alvaro Herrera 2020-09-11 14:45:25 Re: postgr.es/p/githash to redirect to git.postgresql.org?
Previous Message Jehan-Guillaume de Rorthais 2020-09-11 09:48:25 postgr.es/p/githash to redirect to git.postgresql.org?