Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Changed some API checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoso95 committed Apr 6, 2017
1 parent c833e93 commit 727539d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import concordance

PORT = os.environ.get("PORT", "5151")
API_KEY = os.environ.get("API_KEY")
API_KEY = os.environ.get("API_KEY", "h/52y/E7cm8Ih4F3cVdlBM4ZQxER+Apk6P0L7yR0lFU=")

originality_queue = Queue()
concordance_queue = Queue()
Expand All @@ -36,8 +36,8 @@ def queue_for_scoring():
api_key = request.forms.get("api_key")

if API_KEY is None:
logging.getLogger().info("NO API KEY EXITING")
raise Exception()
logging.getLogger().critical("NO API KEY EXITING")
return
if api_key != API_KEY:
logging.getLogger().info("Recieved invalid post request with KEY {} submission id {}".format(api_key, submission_id))
return
Expand Down
2 changes: 1 addition & 1 deletion test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def fetch_competition(db):

def test_server(db_manager, comp_id):
submissions = db_manager.get_everyone_elses_recent_submssions(comp_id, '')
api_key = os.environ.get("API_KEY")
api_key = os.environ.get("API_KEY", "h/52y/E7cm8Ih4F3cVdlBM4ZQxER+Apk6P0L7yR0lFU=")

for submission in submissions:
s_id = submission["submission_id"]
Expand Down

0 comments on commit 727539d

Please sign in to comment.