Infinite recursion on invalid on multiple vote
When trying to vote multiple times on the same poll, the backend send an error You may only vote on this poll once!
The corresponding code il localed on models.py
class VoteViewSet(LDPViewSet):
def is_safe_create(self, user, validated_data, *args, **kwargs):
try:
if 'poll' in validated_data.keys():
poll = Poll.objects.get(urlid=validated_data['poll']['urlid'])
else:
poll = self.get_parent()
if Vote.objects.filter(relatedPoll=poll, user=user).exists():
raise serializers.ValidationError('You may only vote on this poll once!')
except Poll.DoesNotExist:
return True
except (KeyError, AttributeError):
raise Http404('circle not specified with urlid')
return True
But the SIB core enter in infinite recursion, and cannot manage this error.
May it be a problem of component misusage ?