Skip to content

Commit

Permalink
Raise MissingRequired error when no handle is found for a track (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson committed Jan 18, 2022
1 parent 7c31e55 commit d024057
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions discovery-provider/src/tasks/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@ def parse_track_event(
.filter(User.user_id == owner_id, User.is_current == True)
.first()
)[0]
if not handle:
raise EntityMissingRequiredFieldError(
"track",
track_record,
f"No user found for {track_record}",
)

update_track_routes_table(
session, track_record, track_metadata, pending_track_routes
Expand Down Expand Up @@ -476,6 +482,12 @@ def parse_track_event(
.filter(User.user_id == owner_id, User.is_current == True)
.first()
)[0]
if not handle:
raise EntityMissingRequiredFieldError(
"track",
track_record,
f"No user found for {track_record}",
)

update_track_routes_table(
session, track_record, track_metadata, pending_track_routes
Expand Down

0 comments on commit d024057

Please sign in to comment.