Commit a157cc69 authored by Florent Chehab's avatar Florent Chehab

Better backend handling for userData

parent 55165034
Pipeline #26617 passed with stages
in 2 minutes and 51 seconds
......@@ -24,6 +24,11 @@ class UserDataSerializer(MyModelSerializer):
user = self.get_user_in_request()
self.override_validated_data({'owner': user})
# we try to recover the correct instance
query = UserData.objects.filter(owner=user)
if len(query) == 1:
self.instance = query[0]
class Meta:
model = UserData
fields = '__all__'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment