Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: Handle no web seat case on stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jawad-khan committed Jul 24, 2024
1 parent 7dc2fb6 commit b5a5594
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def handle(self, *args, **options):
attribute_values__value_text=CertificateType.VERIFIED,
).exclude(stockrecords__partner_sku__icontains="mobile").first()

if not web_seat:
logger.info('While syncing could not find web seat for {}'.format(product.title) )
continue

for mobile_seat in mobile_seats:
info = 'Syncing {} with {}'.format(mobile_seat.title, web_seat.title)
logger.info(info)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def setUp(self):
self.course_with_audit_seat = self.create_course_and_seats(create_mobile_seats=False, create_web_seat=False)
self.course_with_unsync_seats = self.create_course_and_seats(create_mobile_seats=True, create_web_seat=True)
self.course_with_unsync_seats2 = self.create_course_and_seats(create_mobile_seats=True, create_web_seat=True)
self.course_with_mobile_seats = self.create_course_and_seats(create_mobile_seats=True, create_web_seat=True)
web_seat = self.get_web_seat_for_course(self.course_with_mobile_seats)
web_seat.delete()

mobile_seats = self.get_mobile_seats_for_course(self.course_with_unsync_seats)
mobile_seats = list(mobile_seats) + list(self.get_mobile_seats_for_course(self.course_with_unsync_seats2))

Expand Down

0 comments on commit b5a5594

Please sign in to comment.