Skip to content

Commit

Permalink
Code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
rixx committed Nov 14, 2024
1 parent 9b39e4f commit e1dce86
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions pretalx_salesforce/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ def salesforce_full_speaker_sync(sf, event):
)

for profile in profiles:
try:
sync = profile.salesforce_profile_sync
except SpeakerProfileSalesforceSync.DoesNotExist:
sync = SpeakerProfileSalesforceSync.objects.create(profile=profile)

sync, _ = SpeakerProfileSalesforceSync.objects.get_or_create(
profile=profile
)
sync.sync(sf=sf)


Expand All @@ -124,9 +122,7 @@ def salesforce_full_submission_sync(sf, event):
submissions = event.submissions.all().prefetch_related("speakers")

for submission in submissions:
try:
sync = submission.salesforce_submission_sync
except SubmissionSalesforceSync.DoesNotExist:
sync = SubmissionSalesforceSync.objects.create(submission=submission)

sync, _ = SubmissionSalesforceSync.objects.get_or_create(
submission=submission
)
sync.sync(sf=sf)

0 comments on commit e1dce86

Please sign in to comment.