Guest registration doesn't work
Closed this issue · 7 comments
Describe the bug
If you want to register as a guest for an event using the generated link, you always get the error message that you are already registered as a guest, even if you are not: "Sie sind bereits als Gast für diese Veranstaltung registriert." It is not possible at the moment to register for gestures at events.
To Reproduce
Steps to reproduce the behavior:
Create an event and allow guests. Call up the generated link and fill out the form and submit it.
Expected behavior
It should be possible to register new guests for an event.
Environment
Browser Client: Firefox 121.0, Firefox 120.0.1, Firefox mobile 121.0 and Chromium 110.0.5470.0
OS Client: Windows 11, Android 14, Linux Mint 21.2
OS Server: Ubuntu 22.04.3 LTS (Kernel 5.15.0-91)
Database: MariaDB 10.6.12
Python-Version: 3.10.12
Ephios-Version: v0.15.18
I wasn't able to reproduce this on our staging server given your instructions. I'll test with an environment like yours next.
Even with mariadb 10.6 I could not reproduce the behavior you are seeing (with a freshly migrated database). The culprit seem to be the following lines:
ephios/ephios/plugins/guests/views.py
Lines 66 to 78 in 15204d4
I think you are getting an Integrity Error for some reason. @pov91 Could you try inserting a line using the db shell and posting the output? Should look something like
# in your ephios python env
python -m ephios dbshell
MariaDB [ephios]> INSERT INTO `guests_guestuser` VALUES (10000,'test@example.com','2000-01-01','','7dcW_Hd-RUv_QovqYDBnVF8MVH748sCTHCL_iIhYcm8','2024-01-04 14:00:39.088011',1,'Testname');
I get a Query OK, 1 row affected (0,011 sec)
, but you should be getting something else. If it does work for you however, remember to delete the tuple again.
I think I found the error. I suspect it has to do with the change from first name with last name to a display name. I can read the following fields in my database:
Compared to the schema above in what I should try out, the fields “first_name” and “last_name” are too many. If you read out the fields with "SELECT xyz FROM guests_guestuser;", all fields are filled with content, Except the "display_name" field only shows empty rows.
Could this be the problem? If so, what would be the best way to convert that safely?
I think I found the error. I suspect it has to do with the change from first name with last name to a display name. I can read the following fields in my database:
Compared to the schema above in what I should try out, the fields “first_name” and “last_name” are too many. If you read out the fields with "SELECT xyz FROM guests_guestuser;", all fields are filled with content, Except the "display_name" field only shows empty rows.
Could this be the problem? If so, what would be the best way to convert that safely?
This indeed looks like you messed up migrating when upgrading a version. Might be related to the problem, as the check is based on some combined unique check, but I'm unsure about it.
Can you post the output of python -m ephios migrate --fake
?
Seems like you missed migrating when you did your last update. Unfortunately I just made it hard for you to run the migrations now. Let’s revert faking it and apply it for real. Please do a backup before this.
python -m ephios migrate --fake guests 0004_alter_guestparticipation_options_and_more
python -m ephios migrate guests