minor_errors

minor errors
This commit is contained in:
forsola
2021-04-30 23:41:14 +02:00
parent e3207f52b7
commit 64dbba1b7d
2 changed files with 16 additions and 6 deletions
+12 -1
View File
@@ -86,8 +86,19 @@ class RequestHandler(BaseHTTPRequestHandler):
self.server.logger.error("No code param received.")
self.wfile.write(six.b("ERROR: No code param recevied.\n"))
else:
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
print("Script: %s" %SCRIPT_DIR)
STORAGE_DIR = "%s/../storage" % SCRIPT_DIR
print("Storage: %s" %STORAGE_DIR)
SERVER_IP_FILE = "%s/server-ip.txt" % STORAGE_DIR
if os.path.exists(SERVER_IP_FILE):
with open(SERVER_IP_FILE, 'r') as f:
server_ip = f.read().rstrip('\r\n')
else:
server_ip = '127.0.0.1'
url = client.authorization_url(client_id=self.server.client_id,
redirect_uri='http://18.133.120.5:{}/authorization'.format(self.server.server_port),
redirect_uri='http://' + server_ip + ':{}/authorization'.format(self.server.server_port),
scope='activity:write')
self.send_response(302)
+4 -5
View File
@@ -15,10 +15,10 @@ import threading
import re
import smtplib, ssl
import subprocess
#import subprocess
import requests
import protobuf.activity_pb2 as activity_pb2
import protobuf.profile_pb2 as profile_pb2
#import protobuf.activity_pb2 as activity_pb2
#import protobuf.profile_pb2 as profile_pb2
import scripts.online_sync as online_sync
from copy import copy
@@ -830,8 +830,7 @@ def api_events_search():
critccw_cat.route_id = 2875658892
critccw_cat.startLocation = cat
critccw_cat.label = cat
return '', 200
return events.SerializeToString(), 200
@app.route('/api/events/subgroups/signup/<int:event_id>', methods=['POST'])
def api_events_subgroups_signup_id(event_id):