From 2a6adca44f5a8a946fee8d79812406c9871ae944 Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Tue, 22 Jan 2013 22:44:35 -0500 Subject: [PATCH] customize google drive auth module for new security layout --- karmaworld/apps/notes/admin.py | 4 +++- karmaworld/apps/notes/gdrive.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/karmaworld/apps/notes/admin.py b/karmaworld/apps/notes/admin.py index ef5d459..650e9cb 100644 --- a/karmaworld/apps/notes/admin.py +++ b/karmaworld/apps/notes/admin.py @@ -5,6 +5,8 @@ from django.contrib import admin -import models +from karmaworld.apps.notes import models + +admin.site.register(models.DriveAuth) admin.site.register(models.Note) diff --git a/karmaworld/apps/notes/gdrive.py b/karmaworld/apps/notes/gdrive.py index 61407db..b4d3314 100644 --- a/karmaworld/apps/notes/gdrive.py +++ b/karmaworld/apps/notes/gdrive.py @@ -9,13 +9,19 @@ import os import httplib2 from apiclient.discovery import build from apiclient.http import MediaFileUpload +from django.conf import settings from oauth2client.client import flow_from_clientsecrets from karmaworld.apps.notes.models import DriveAuth, Note -CLIENT_SECRET = './notes/client_secrets.json' # FIXME +CLIENT_SECRET = os.path.join(settings.DJANGO_ROOT, \ + 'secret/client_secrets.json') #from credentials import GOOGLE_USER # FIXME -GOOGLE_USER = 'admin@karmanotes.org' # FIXME +try: + from secrets.drive import GOOGLE_USER +except: + GOOGLE_USER = 'admin@karmanotes.org' # FIXME + EXT_TO_MIME = {'.docx': 'application/msword'} def build_flow(): -- 2.25.1