Skip to content

Commit

Permalink
submission code
Browse files Browse the repository at this point in the history
  • Loading branch information
wslyvh committed Aug 21, 2024
1 parent c915385 commit 0e3b2df
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pretalx_webhook/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

logger = logging.getLogger(__name__)

def get_submission_code(data):
submission = data.get('submission')
return submission.code if submission and hasattr(submission, 'code') else None

@receiver(schedule_release, dispatch_uid="pretalx_webhook_schedule_release")
def on_schedule_release(sender, schedule, user, **kwargs):
try:
Expand All @@ -33,9 +29,9 @@ def on_schedule_release(sender, schedule, user, **kwargs):
'user': str(user),
'schedule': schedule.version,
'changes': {
'new_talks': [get_submission_code(talk) for talk in schedule.changes.get('new_talks', [])],
'canceled_talks': [get_submission_code(talk) for talk in schedule.changes.get('canceled_talks', [])],
'moved_talks': [get_submission_code(talk) for talk in schedule.changes.get('moved_talks', [])],
'new_talks': [talk['submission'].code for talk in schedule.changes.get('new_talks', [])],
'canceled_talks': [talk['submission'].code for talk in schedule.changes.get('canceled_talks', [])],
'moved_talks': [talk['submission'].code for talk in schedule.changes.get('moved_talks', [])],
},
}

Expand Down

0 comments on commit 0e3b2df

Please sign in to comment.