Debug output for google sync
This commit is contained in:
parent
1aa23d2691
commit
5fc206112d
|
@ -242,6 +242,7 @@ def syncFromGoogleToLocal( service = None ):
|
|||
|
||||
if service is None: service = getServiceObject()
|
||||
|
||||
newStatusReceived = False
|
||||
allEvents = getAllGCalEvents( service, fromNow=True)
|
||||
for e in allEvents:
|
||||
localId = e['extendedProperties']['private']['blechreizID']
|
||||
|
@ -268,6 +269,9 @@ def syncFromGoogleToLocal( service = None ):
|
|||
# and an endless loop is entered
|
||||
if prev.status != part.status or prev.comment != part.comment:
|
||||
part.save()
|
||||
newStatusReceived = True
|
||||
|
||||
return newStatusReceived
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ from django.shortcuts import redirect
|
|||
from eventplanner_gcal.google_sync import syncFromGoogleToLocal, syncFromLocalToGoogle
|
||||
from django.http import HttpResponse
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from pprint import pformat
|
||||
|
||||
import logging
|
||||
|
||||
|
@ -14,8 +15,11 @@ def runSync( request ):
|
|||
|
||||
@csrf_exempt
|
||||
def gcalApiCallback( request ):
|
||||
syncFromGoogleToLocal()
|
||||
logger.info("Received callback from GCal - updating event participations... ")
|
||||
# TODO check channel info here
|
||||
requestMetaStr = pformat( request.META )
|
||||
logger.info( "Received Google Callback with the following headers:\n" + requestMetaStr )
|
||||
result = syncFromGoogleToLocal()
|
||||
logger.info("Finished processing callback from GCal - New Information present: %1 " %(result, ) )
|
||||
return HttpResponse('<h1>Callback successful</h1>')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue