diff --git a/blechreiz/calendarCredentials.dat b/blechreiz/calendarCredentials.dat index efd1a9e..88aead4 100644 --- a/blechreiz/calendarCredentials.dat +++ b/blechreiz/calendarCredentials.dat @@ -1 +1 @@ -{"_module": "oauth2client.client", "token_expiry": "2014-06-20T09:36:07Z", "access_token": "ya29.LgA4Q4jhQqjEoBwAAABv_luKCAgrb2C-s1IcYmGZ8nZViS_QHvHKT-IkSo31RQ", "token_uri": "https://accounts.google.com/o/oauth2/token", "invalid": false, "token_response": {"access_token": "ya29.LgA4Q4jhQqjEoBwAAABv_luKCAgrb2C-s1IcYmGZ8nZViS_QHvHKT-IkSo31RQ", "token_type": "Bearer", "expires_in": 3600}, "client_id": "34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com", "id_token": null, "client_secret": "y4t9XBrJdCODPTO5UvtONWWn", "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", "_class": "OAuth2Credentials", "refresh_token": "1/7-6-m_lLAKX8IeD7OuGtkcIiprty_nZUSxhMunSC5b0", "user_agent": null} \ No newline at end of file +{"_module": "oauth2client.client", "token_expiry": "2018-12-18T12:55:20Z", "access_token": "ya29.Gl12BuJlFBtRZSBtMkxubhfG8rYDsLUgc1yKMpO9_aE3tmi4sLFGLq_Djq5R9zr1919oZAobX0oaD6bTj3s4i9kqWfw0gpOGKJKRHM1Y9gHc0JsCe2kChNszu_RCAaE", "token_uri": "https://accounts.google.com/o/oauth2/token", "invalid": false, "token_response": {"access_token": "ya29.Gl12BuJlFBtRZSBtMkxubhfG8rYDsLUgc1yKMpO9_aE3tmi4sLFGLq_Djq5R9zr1919oZAobX0oaD6bTj3s4i9kqWfw0gpOGKJKRHM1Y9gHc0JsCe2kChNszu_RCAaE", "scope": "https://www.googleapis.com/auth/calendar", "expires_in": 3600, "token_type": "Bearer"}, "client_id": "34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com", "id_token": null, "client_secret": "y4t9XBrJdCODPTO5UvtONWWn", "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", "_class": "OAuth2Credentials", "refresh_token": "1/txixroRJyyVmuENPpaXyB_bGeXa1XV-pClAxqKHk_5-JW1qGFE0Gl-WlgCu1Eizq", "user_agent": null} \ No newline at end of file diff --git a/blechreiz/database.sqlite b/blechreiz/database.sqlite new file mode 100644 index 0000000..7e40204 Binary files /dev/null and b/blechreiz/database.sqlite differ diff --git a/blechreiz/media/user_images/Enzi.png b/blechreiz/media/user_images/Enzi.png new file mode 100644 index 0000000..85cd638 Binary files /dev/null and b/blechreiz/media/user_images/Enzi.png differ diff --git a/blechreiz/media/user_images/Enzi_thumb.png b/blechreiz/media/user_images/Enzi_thumb.png new file mode 100644 index 0000000..85cd638 Binary files /dev/null and b/blechreiz/media/user_images/Enzi_thumb.png differ diff --git a/blechreiz/media/user_images/tatjana.png b/blechreiz/media/user_images/tatjana.png new file mode 100644 index 0000000..2df5b13 Binary files /dev/null and b/blechreiz/media/user_images/tatjana.png differ diff --git a/blechreiz/media/user_images/tatjana_thumb.png b/blechreiz/media/user_images/tatjana_thumb.png new file mode 100644 index 0000000..2df5b13 Binary files /dev/null and b/blechreiz/media/user_images/tatjana_thumb.png differ diff --git a/blechreiz/settings.py b/blechreiz/settings.py index 7d0bacd..cafb11f 100644 --- a/blechreiz/settings.py +++ b/blechreiz/settings.py @@ -183,8 +183,7 @@ GCAL_COUPLING = { 'clientId' : '34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com', 'client_secret' : 'y4t9XBrJdCODPTO5UvtONWWn', 'credentials_file' : PROJECT_PATH + '/calendarCredentials.dat', - 'push_url' : "https://test.bauer.technology/eventplanner_gcal/gcalApiCallback", - #'push_url' : "https://test.bauer.technology/callbackTest2.php", + 'push_url' : "https://blechreiz.bauer.technology/eventplanner_gcal/gcalApiCallback", } diff --git a/eventplanner_gcal/google_sync.py b/eventplanner_gcal/google_sync.py index 4da7eb2..9debd81 100644 --- a/eventplanner_gcal/google_sync.py +++ b/eventplanner_gcal/google_sync.py @@ -19,13 +19,18 @@ def createGCalServiceObject(): """Creates a Google API service object. This object is required whenever a Google API call is made""" from oauth2client.file import Storage from apiclient.discovery import build + from oauth2client import tools, client gcal_settings = settings.GCAL_COUPLING storage = Storage( gcal_settings['credentials_file'] ) credentials = storage.get() + print("credentials", credentials) if credentials is None or credentials.invalid == True: + #flow = client.flow_from_clientsecrets(CLIENT_SEICRET_FILE, SCOPES) + + print("invalid credentials for gcal") logger.error("Unable to initialize Google Calendar coupling. Check your settings!") return None @@ -34,6 +39,7 @@ def createGCalServiceObject(): res = build( serviceName='calendar', version='v3', http=http, developerKey=gcal_settings['developerKey'] ) + print("res", res) if res is None: logger.error( "Authentication at google API failed. Check your settings!" ) return res @@ -216,8 +222,9 @@ def syncFromLocalToGoogle( service = None ): """ Creates a google event for each local event (if it does not exist yet) and deletes all google events that are not found in local database. Updates participation info of gcal events using local data """ + if service is None: service = getServiceObject() - + allEvents = getAllGCalEvents( service ) eventsAtGoogle_djangoID = set() @@ -271,7 +278,7 @@ def syncFromLocalToGoogle( service = None ): def syncFromGoogleToLocal( service = None ): """Retrieves only participation infos for all events and updates local database if anything has changed. """ - + if service is None: service = getServiceObject() newStatusReceived = False diff --git a/eventplanner_gcal/googleapiTest/calendarCredentials.dat b/eventplanner_gcal/googleapiTest/calendarCredentials.dat index f3fd339..954a925 100644 --- a/eventplanner_gcal/googleapiTest/calendarCredentials.dat +++ b/eventplanner_gcal/googleapiTest/calendarCredentials.dat @@ -1 +1 @@ -{"_module": "oauth2client.client", "token_expiry": "2014-03-08T14:33:53Z", "access_token": "ya29.1.AADtN_UH8eRhIXsdwF4W1D5oC8xYlMhG-0qeT210pyb6pxk7LTLmd-EnUNVS2UjJZQ", "token_uri": "https://accounts.google.com/o/oauth2/token", "invalid": false, "token_response": {"access_token": "ya29.1.AADtN_UH8eRhIXsdwF4W1D5oC8xYlMhG-0qeT210pyb6pxk7LTLmd-EnUNVS2UjJZQ", "token_type": "Bearer", "expires_in": 3600}, "client_id": "34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com", "id_token": null, "client_secret": "y4t9XBrJdCODPTO5UvtONWWn", "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", "_class": "OAuth2Credentials", "refresh_token": "1/7-6-m_lLAKX8IeD7OuGtkcIiprty_nZUSxhMunSC5b0", "user_agent": null} \ No newline at end of file +{"_module": "oauth2client.client", "token_expiry": "2017-10-24T07:29:15Z", "access_token": "ya29.GlvuBAjiaOmu9fZaR9RElCkEvkcJVv-lL-hsL8bGczd-Lvl-y_vYA-dHPmCurc111i7SwLCY2nWRrUcZneR3bwGQuOW8j6MbeYncJDRcpjqYJBGpJUxuTizafOOv", "token_uri": "https://accounts.google.com/o/oauth2/token", "invalid": false, "token_response": {"access_token": "ya29.GlvuBAjiaOmu9fZaR9RElCkEvkcJVv-lL-hsL8bGczd-Lvl-y_vYA-dHPmCurc111i7SwLCY2nWRrUcZneR3bwGQuOW8j6MbeYncJDRcpjqYJBGpJUxuTizafOOv", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "1/txixroRJyyVmuENPpaXyB_bGeXa1XV-pClAxqKHk_5-JW1qGFE0Gl-WlgCu1Eizq"}, "client_id": "34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com", "id_token": null, "client_secret": "y4t9XBrJdCODPTO5UvtONWWn", "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", "_class": "OAuth2Credentials", "refresh_token": "1/txixroRJyyVmuENPpaXyB_bGeXa1XV-pClAxqKHk_5-JW1qGFE0Gl-WlgCu1Eizq", "user_agent": null} \ No newline at end of file diff --git a/eventplanner_gcal/googleapiTest/createCredentials.py b/eventplanner_gcal/googleapiTest/createCredentials.py index 905ae16..cb8772e 100644 --- a/eventplanner_gcal/googleapiTest/createCredentials.py +++ b/eventplanner_gcal/googleapiTest/createCredentials.py @@ -16,7 +16,9 @@ if createLink: print "Visit this link - grab the key from the url and paste it into the else block" exit(0) else: - code = "4/Iais8aK8_KxbMQjq3Rtw3PFXu6Nr.8itpukY_6ZgZOl05ti8ZT3ax27a3hAI" + #code = "4/Iais8aK8_KxbMQjq3Rtw3PFXu6Nr.8itpukY_6ZgZOl05ti8ZT3ax27a3hAI" + #code = "4/YjdxGI8sIokRhYVE18ut9WMeYbmRLfazB-HOGCyqo4M#" + code = "4/3EhMJx4WlXrZhyEwGGiHG-rhJzZAPrALFEYJpfvp5J8#" credentials = flow.step2_exchange( code ) storage = Storage('calendarCredentials.dat') storage.put( credentials )