Re: commitfest app returning error 500 - Mailing list pgsql-www

From Magnus Hagander
Subject Re: commitfest app returning error 500
Date
Msg-id CABUevEwQyDkgrUhq1rUcoHf6KUdupeRPxJTc-cYJAQ4kMz7rYQ@mail.gmail.com
Whole thread Raw
In response to commitfest app returning error 500  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-www


On Fri, Sep 11, 2020 at 12:48 AM Alvaro Herrera <alvherre@alvh.no-ip.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?

--

pgsql-www by date:

Previous
From: Jehan-Guillaume de Rorthais
Date:
Subject: postgr.es/p/githash to redirect to git.postgresql.org?
Next
From: Alvaro Herrera
Date:
Subject: Re: postgr.es/p/githash to redirect to git.postgresql.org?