🐛(backend) manage invitation partial update without email
An invitation can be updated to change its role. The front use a PATCH sending only the changed role, so the email is missing in the InivtationSerializer.validate method. We have to check first if an email is present before working on it.
This commit is contained in:
@@ -749,7 +749,8 @@ class InvitationSerializer(serializers.ModelSerializer):
|
||||
if self.instance is None:
|
||||
attrs["issuer"] = user
|
||||
|
||||
attrs["email"] = attrs["email"].lower()
|
||||
if attrs.get("email"):
|
||||
attrs["email"] = attrs["email"].lower()
|
||||
|
||||
return attrs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user