changeset 454:5b2114cec3e3

Working on #220. Can't test locally, so committing in increments.
author Brian Neal <bgneal@gmail.com>
date Thu, 30 Jun 2011 02:30:30 +0000
parents 532b9c6f2482
children e44dd53885dc
files gpp/gcalendar/admin.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/gcalendar/admin.py	Thu Jun 30 02:22:16 2011 +0000
+++ b/gpp/gcalendar/admin.py	Thu Jun 30 02:30:30 2011 +0000
@@ -6,6 +6,7 @@
 from django.conf.urls.defaults import *
 from django.contrib import admin
 from django.contrib import messages
+from django.contrib.sites.models import Site
 from django.core.urlresolvers import reverse
 from django.http import HttpResponse
 from django.http import HttpResponseRedirect
@@ -119,7 +120,9 @@
         authorize it.
 
         """
-        callback_url = reverse('admin:gcalendar-get_access_token')
+        site = Site.objects.get_current()
+        callback_url = 'http://%s%s' % (site.domain,
+                reverse('admin:gcalendar-get_access_token'))
         try:
             auth_url = oauth.fetch_auth(request, SCOPES, callback_url)
         except gdata.client.Error, e: