diff gpp/gcalendar/admin.py @ 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 345825e6dcae
children 5be072292e2d
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: