File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
contentcuration/contentcuration/views Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -471,11 +471,13 @@ def create_channel(channel_data, user):
471471 # Set up initial channel
472472 channel , isNew = Channel .objects .get_or_create (id = channel_data ["id" ], actor_id = user .id )
473473
474- # Add user as editor if channel is new or channel has no editors
475- # Otherwise, check if user is an editor
476- if isNew or channel .editors .count () == 0 :
474+ # Add user as editor if channel is new
475+ if isNew :
477476 channel .editors .add (user )
478- elif user not in channel .editors .all ():
477+ try :
478+ # Check if user is an editor
479+ channel = Channel .get_editable (user , channel .id )
480+ except Channel .DoesNotExist :
479481 raise SuspiciousOperation ("User is not authorized to edit this channel" )
480482
481483 extra_fields = channel_data .get ('extra_fields' ) or {}
You can’t perform that action at this time.
0 commit comments