Skip to content
Snippets Groups Projects
Verified Commit 363685e4 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: use the instance’s value for timeslot, fix parenthesis

parent a16aed02
No related branches found
No related tags found
No related merge requests found
......@@ -1023,10 +1023,9 @@ class NoteSerializer(serializers.ModelSerializer):
a show.
"""
show = validated_data["timeslot"].schedule.show
user = self.context.get("request").user
user_is_privileged = user.groups.filter(name=settings.PRIVILEGED_GROUP).exists()
user_is_owner = user in show.owners
user_is_owner = user in instance.timeslot.schedule.show.owners
# Only privileged users and owners of a show are allowed to update a note
# Being a privileged user overrides the ownership
......@@ -1050,7 +1049,7 @@ class NoteSerializer(serializers.ModelSerializer):
instance.language.set(language)
# Only update this field if the user is privileged, ignore otherwise
if topic := validated_data.get("topic") and user_is_privileged:
if (topic := validated_data.get("topic")) and user_is_privileged:
instance.topic.set(topic)
if cba_id := validated_data.get("cba_id"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment