Refactored google calendar sync

This commit is contained in:
Martin Bauer
2014-04-26 11:17:10 +02:00
committed by Martin Bauer
parent 46b4078fac
commit 1aa23d2691
11 changed files with 370 additions and 374 deletions

View File

@@ -1,6 +1,5 @@
from django.shortcuts import redirect
from eventplanner_gcal.models import syncGCalEvents, syncParticipationFromGoogleToLocal
from eventplanner_gcal.signals import onGoogleCallback
from eventplanner_gcal.google_sync import syncFromGoogleToLocal, syncFromLocalToGoogle
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
@@ -10,13 +9,12 @@ logger = logging.getLogger( __name__ )
def runSync( request ):
syncGCalEvents()
syncFromLocalToGoogle()
return redirect("/")
@csrf_exempt
def gcalApiCallback( request ):
onGoogleCallback()
syncFromGoogleToLocal()
logger.info("Received callback from GCal - updating event participations... ")
return HttpResponse('<h1>Callback successful</h1>')