@@ -316,10 +316,22 @@ def event_registration_form_deleted(self, registration_form, **kwargs):
316
316
self .logger .info ('Registration removed (form deleted): removing %s in %s' , registration .user , event )
317
317
318
318
def event_updated (self , event , changes , ** kwargs ):
319
- monitored_keys = {'title' , 'description' , 'location_data' , 'person_links' , 'start_dt' , 'end_dt' , 'duration' }
319
+ monitored_keys = {'title' , 'description' , 'location_data' , 'person_links' ,
320
+ 'start_dt' , 'end_dt' , 'duration' , 'label' }
320
321
if not changes .keys () & monitored_keys :
321
322
return
322
323
324
+ if 'label' in changes :
325
+ (old_label , new_label ) = changes ['label' ]
326
+ # If the event is not happening, treat this as a deletion
327
+ if new_label and new_label .is_event_not_happening :
328
+ self .event_deleted (event , ** kwargs )
329
+ return
330
+ # If the event wasn't happening before but it is now, treat this as a creation
331
+ if new_label and not new_label .is_event_not_happening and old_label and old_label .is_event_not_happening :
332
+ self .event_created (event , ** kwargs )
333
+ return
334
+
323
335
users_to_update = set ()
324
336
# Registered users need to be informed about changes
325
337
for user in get_registered_users (event ):
0 commit comments