diff gcalendar/admin.py @ 991:4aadaf3bc234

Added SITE_SCHEME setting. Configure site scheme to be either http or https based on SITE_SCHEME setting. Updated code to use it.
author Brian Neal <bgneal@gmail.com>
date Sun, 01 Nov 2015 15:56:05 -0600
parents 9165edfb1709
children 5ba2508939f7
line wrap: on
line diff
--- a/gcalendar/admin.py	Sat Oct 31 17:36:31 2015 -0500
+++ b/gcalendar/admin.py	Sun Nov 01 15:56:05 2015 -0600
@@ -114,7 +114,9 @@
         This view generates the authorization URL and redirects the user to it.
         """
         site = Site.objects.get_current()
-        callback_url = 'http://%s%s' % (site.domain,
+        callback_url = '%s://%s%s' % (
+                settings.SITE_SCHEME,
+                site.domain,
                 reverse('admin:gcalendar-auth_return'))
         auth_url = oauth.get_auth_url(callback_url)
         return HttpResponseRedirect(auth_url)