dlespiau / patchwork

The freedesktop.org edition of patchwork. Patchwork is a web patch tracking system for projects using a mailing list for contributions and reviews.
http://patchwork-freedesktop.readthedocs.org/en/latest/
GNU General Public License v2.0
22 stars 13 forks source link

Cannot change patch state using pwclient #168

Closed asdil12 closed 8 years ago

asdil12 commented 8 years ago

When I try to update the patch state, I get this error:

root@server2 ~ # /opt/patchwork/patchwork/bin/pwclient update -s Superseded 2
Error updating patch: <type 'exceptions.ValueError'>:Cannot assign "<SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x7f3be8a25190>>": "EventLog.user" must be a "User" instance.
Patch not updated

There is no error, when I specify the state that the patch already has:

root@server2 ~ # /opt/patchwork/patchwork/bin/pwclient update -s New 2

I can set the patch to archived / not archived:

root@server2 ~ # /opt/patchwork/patchwork/bin/pwclient update -a yes 2
root@server2 ~ # /opt/patchwork/patchwork/bin/pwclient update -a no 2

I can set the patch state via webUI as well.

dlespiau commented 8 years ago

Eeek, that's a regression from the recent work from Jose, and we didn't have code coverage for that part. I can reproduce the problem but trying to reproduce it in a unit test doesn't seem to work.

There's definitely something fishy with the interaction between the XMLRPC request processing and middleware classes (we use such a class to store the current user from the request in thread local storage data). Needs debugging.

In the mean time, you should be able to use commit 30abcc0ca0c5712707aa808e26cc3bdcdd20d61 without this problem.