Skip to content

Commit

Permalink
Update scripts (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmi4er4 authored Jun 18, 2024
1 parent 9580bb3 commit 3d85ec7
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,14 @@ def handle(self, *args, **options):
score = Decimal(row[1])

try:
applicant = Applicant.objects.get(yandex_login=yandex_login, campaign__in=campaigns)
applicant = Applicant.objects.get(yandex_login=yandex_login, campaign__in=campaigns,
status__in=before_exam)
except Applicant.DoesNotExist:
self.stdout.write(self.style.ERROR(f'Applicant with login {yandex_login} does not exist'))
continue
except Applicant.MultipleObjectsReturned:
self.stdout.write(self.style.ERROR(f'There are many applicants with login {yandex_login}'))
continue
if applicant.status not in before_exam:
self.stdout.write(self.style.ERROR(f'Invalid status for applicant {yandex_login}: '
f'{applicant.status}'))
continue
total_by_compaign[applicant.campaign] += 1
exam, created = Exam.objects.get_or_create(applicant=applicant,
defaults={
Expand Down

0 comments on commit 3d85ec7

Please sign in to comment.