blechreiz-website/eventplanner_gcal/views.py

29 lines
620 B
Python
Raw Normal View History

2014-03-08 22:36:25 +01:00
from django.shortcuts import redirect
from eventplanner_gcal.models import syncGCalEvents, syncParticipationFromGoogleToLocal
from eventplanner_gcal.signals import onGoogleCallback
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 ):
syncGCalEvents()
2014-03-08 22:36:25 +01:00
return redirect("/")
@csrf_exempt
def gcalApiCallback( request ):
onGoogleCallback()
logger.info("Received callback from GCal - updating event participations... ")
return HttpResponse('<h1>Callback successful</h1>')