Dirty catch all in GCAL handling
This commit is contained in:
parent
828901111e
commit
a8e6ca89fd
|
@ -19,25 +19,36 @@ logger = logging.getLogger( __name__ )
|
||||||
def event_post_save_handler( **kwargs):
|
def event_post_save_handler( **kwargs):
|
||||||
event = kwargs['instance']
|
event = kwargs['instance']
|
||||||
created = kwargs['created']
|
created = kwargs['created']
|
||||||
if created:
|
try:
|
||||||
logger.info("Creating Gcal event")
|
if created:
|
||||||
response = createGCalEvent( getServiceObject(), event ).execute()
|
logger.info("Creating Gcal event")
|
||||||
onGcalEventCreated( None, response, None )
|
response = createGCalEvent( getServiceObject(), event ).execute()
|
||||||
else:
|
onGcalEventCreated( None, response, None )
|
||||||
logger.info( "Updating Gcal event")
|
else:
|
||||||
updateGCalEvent( getServiceObject(),event ).execute()
|
logger.info( "Updating Gcal event")
|
||||||
|
updateGCalEvent( getServiceObject(),event ).execute()
|
||||||
|
except:
|
||||||
|
logger.error( "Error updating Gcal event")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@receiver( pre_delete,sender= Event)
|
@receiver( pre_delete,sender= Event)
|
||||||
def event_pre_delete_handler( **kwargs):
|
def event_pre_delete_handler( **kwargs):
|
||||||
event = kwargs['instance']
|
try:
|
||||||
logger.info ("Deleting GCAL event")
|
event = kwargs['instance']
|
||||||
deleteGCalEvent( getServiceObject(), event ).execute()
|
logger.info ("Deleting GCAL event")
|
||||||
|
deleteGCalEvent( getServiceObject(), event ).execute()
|
||||||
|
except:
|
||||||
|
logger.error("Error deleting GCAL event")
|
||||||
|
|
||||||
|
|
||||||
@receiver( post_save, sender=EventParticipation )
|
@receiver( post_save, sender=EventParticipation )
|
||||||
def participation_post_save_handler( **kwargs):
|
def participation_post_save_handler( **kwargs):
|
||||||
participation = kwargs['instance']
|
try:
|
||||||
logger.info("Participation post save -> update gcal")
|
participation = kwargs['instance']
|
||||||
updateGCalEvent( getServiceObject(), participation.event ).execute()
|
logger.info("Participation post save -> update gcal")
|
||||||
|
updateGCalEvent( getServiceObject(), participation.event ).execute()
|
||||||
|
except:
|
||||||
|
logger.error("Error deleting GCAL event")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue