Skip to content

Commit

Permalink
lint + fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
michellebrier committed Feb 29, 2024
1 parent 88371b0 commit 8bb4bbc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/discovery-provider/src/api/v1/models/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"favorite_count": fields.Integer(required=True),
"total_play_count": fields.Integer(required=True),
"user": fields.Nested(user_model, required=True),
"ddex_app": fields.String(allow_null=True)
"ddex_app": fields.String(allow_null=True),
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
EntityType,
ManageEntityParameters,
copy_record,
validate_signer,
is_ddex_signer,
validate_signer,
)
from src.tasks.metadata import immutable_playlist_fields
from src.tasks.task_helpers import generate_slug_and_collision_id
Expand Down Expand Up @@ -414,8 +414,12 @@ def dispatch_challenge_playlist_upload(

def validate_update_ddex_playlist(params: ManageEntityParameters, playlist_record):
if playlist_record.ddex_app:
if playlist_record.ddex_app != params.signer or not is_ddex_signer(params.signer):
raise IndexingValidationError(f"Signer {params.signer} does not have permission to {params.action} DDEX playlist {playlist_record.playlist_id}")
if playlist_record.ddex_app != params.signer or not is_ddex_signer(
params.signer
):
raise IndexingValidationError(
f"Signer {params.signer} does not have permission to {params.action} DDEX playlist {playlist_record.playlist_id}"
)


def update_playlist(params: ManageEntityParameters):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
EntityType,
ManageEntityParameters,
copy_record,
validate_signer,
is_ddex_signer,
validate_signer,
)
from src.tasks.metadata import immutable_track_fields
from src.tasks.task_helpers import generate_slug_and_collision_id
Expand Down Expand Up @@ -491,7 +491,9 @@ def create_track(params: ManageEntityParameters):
def validate_update_ddex_track(params: ManageEntityParameters, track_record):
if track_record.ddex_app:
if track_record.ddex_app != params.signer or not is_ddex_signer(params.signer):
raise IndexingValidationError(f"Signer {params.signer} does not have permission to {params.action} DDEX track {track_record.track_id}")
raise IndexingValidationError(
f"Signer {params.signer} does not have permission to {params.action} DDEX track {track_record.track_id}"
)


def update_track(params: ManageEntityParameters):
Expand Down

0 comments on commit 8bb4bbc

Please sign in to comment.