Closed elnygren closed 1 year ago
More info:
GRAPPELLI_SWITCH_USER_REGEX = "[0-9a-f-]+"
in settings.py helps to get past the initial problem.
However, changing users will still break because user.id
is of type UUID and is not JSON Serializable:
TypeError at /grappelli/switch/user/018aadff-27a6-471d-95aa-783d855c3237/
Object of type UUID is not JSON serializable
The problem is likely in the following row as setting original_user.id
in Session won't work
Because Django does not support signing UUIDs (unless you cast to str first) in session:
@elnygren Why did you close this?
@sehmaschine because session serializer can be used to fix this issue: just make it (de)serialize ULID/UUID properly with a proper JSONEncoder
Custom User model with
is_staff
andis_superuser
both implemented. Primary Key is an UUIDField. Grappelli 3.0.8 and latest Django.