2014-03-08 22:36:25 +01:00
|
|
|
from django.shortcuts import redirect
|
2014-04-26 11:17:10 +02:00
|
|
|
from eventplanner_gcal.google_sync import syncFromGoogleToLocal, syncFromLocalToGoogle
|
2014-04-21 09:21:59 +02:00
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
logger = logging.getLogger( __name__ )
|
2014-03-08 22:36:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
def runSync( request ):
|
2014-04-26 11:17:10 +02:00
|
|
|
syncFromLocalToGoogle()
|
2014-03-08 22:36:25 +01:00
|
|
|
return redirect("/")
|
|
|
|
|
2014-04-21 09:21:59 +02:00
|
|
|
@csrf_exempt
|
2014-04-19 20:36:01 +02:00
|
|
|
def gcalApiCallback( request ):
|
2014-04-26 11:17:10 +02:00
|
|
|
syncFromGoogleToLocal()
|
2014-04-21 09:21:59 +02:00
|
|
|
logger.info("Received callback from GCal - updating event participations... ")
|
|
|
|
return HttpResponse('<h1>Callback successful</h1>')
|
2014-04-19 20:36:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|