27 lines
571 B
Python
27 lines
571 B
Python
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
|
|
|
|
import logging
|
|
|
|
logger = logging.getLogger( __name__ )
|
|
|
|
|
|
def runSync( request ):
|
|
syncFromLocalToGoogle()
|
|
return redirect("/")
|
|
|
|
@csrf_exempt
|
|
def gcalApiCallback( request ):
|
|
syncFromGoogleToLocal()
|
|
logger.info("Received callback from GCal - updating event participations... ")
|
|
return HttpResponse('<h1>Callback successful</h1>')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|