|
|
@ -137,7 +137,7 @@ def api_args(): |
|
|
|
# Write to the database |
|
|
|
with sqlite3.connect("queermottoapi.db") as con: |
|
|
|
cur = con.cursor() |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?)",(timestamp,seedText,refusal_code,refusal_message) ) |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,ORGANISATION,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?,?)",(timestamp,org,seedText,refusal_code,refusal_message) ) |
|
|
|
con.commit() |
|
|
|
return jsonify(refusal_message) |
|
|
|
|
|
|
@ -149,7 +149,7 @@ def api_args(): |
|
|
|
# Write to the database |
|
|
|
with sqlite3.connect("queermottoapi.db") as con: |
|
|
|
cur = con.cursor() |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?)",(timestamp,seedText,refusal_code,refusal_message) ) |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,ORGANISATION,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?,?)",(timestamp,org,seedText,refusal_code,refusal_message) ) |
|
|
|
con.commit() |
|
|
|
return jsonify(refusal_message) |
|
|
|
|
|
|
@ -173,18 +173,19 @@ def api_args(): |
|
|
|
# Write to the database |
|
|
|
with sqlite3.connect("queermottoapi.db") as con: |
|
|
|
cur = con.cursor() |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?)",(timestamp,seedText,refusal_code,refusal_message) ) |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,ORGANISATION,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?,?)",(timestamp,org,seedText,refusal_code,refusal_message) ) |
|
|
|
con.commit() |
|
|
|
return jsonify(refusal_message) |
|
|
|
else: |
|
|
|
moment = datetime.datetime.now(tz) |
|
|
|
timestamp = moment.__str__() |
|
|
|
refusal_code = 402 |
|
|
|
refusal_message = build_error_three() |
|
|
|
refusal_code = 401 |
|
|
|
refusal_message = build_error_two() |
|
|
|
org = "Someone" |
|
|
|
# Write to the database |
|
|
|
with sqlite3.connect("queermottoapi.db") as con: |
|
|
|
cur = con.cursor() |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?)",(timestamp,seedText,refusal_code,refusal_message) ) |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,ORGANISATION,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?,?)",(timestamp,org,seedText,refusal_code,refusal_message) ) |
|
|
|
con.commit() |
|
|
|
return jsonify(refusal_message) |
|
|
|
|
|
|
@ -195,10 +196,11 @@ def error_fourzerozero(e): |
|
|
|
timestamp = moment.__str__() |
|
|
|
refusal_code = 401 |
|
|
|
refusal_message = build_error_two() |
|
|
|
org = "Someone" |
|
|
|
# Write to the database |
|
|
|
with sqlite3.connect("queermottoapi.db") as con: |
|
|
|
cur = con.cursor() |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?)",(timestamp,seedText,refusal_code,refusal_message) ) |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,ORGANISATION,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?,?)",(timestamp,org,seedText,refusal_code,refusal_message) ) |
|
|
|
con.commit() |
|
|
|
return jsonify(refusal_message) |
|
|
|
|
|
|
@ -208,10 +210,11 @@ def error_fourzerofour(e): |
|
|
|
timestamp = moment.__str__() |
|
|
|
refusal_code = 401 |
|
|
|
refusal_message = build_error_two() |
|
|
|
org = "Someone" |
|
|
|
# Write to the database |
|
|
|
with sqlite3.connect("queermottoapi.db") as con: |
|
|
|
cur = con.cursor() |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?)",(timestamp,seedText,refusal_code,refusal_message) ) |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,ORGANISATION,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?,?)",(timestamp,org,seedText,refusal_code,refusal_message) ) |
|
|
|
con.commit() |
|
|
|
return jsonify(refusal_message) |
|
|
|
|
|
|
@ -221,10 +224,11 @@ def error_fivezerozero(e): |
|
|
|
timestamp = moment.__str__() |
|
|
|
refusal_code = 401 |
|
|
|
refusal_message = build_error_two() |
|
|
|
org = "Someone" |
|
|
|
# Write to the database |
|
|
|
with sqlite3.connect("queermottoapi.db") as con: |
|
|
|
cur = con.cursor() |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?)",(timestamp,seedText,refusal_code,refusal_message) ) |
|
|
|
cur.execute("INSERT INTO mottos (TIMESTAMP,ORGANISATION,SEEDTEXT,REFUSAL_CODE,REFUSAL_MESSAGE) VALUES (?,?,?,?,?)",(timestamp,org,seedText,refusal_code,refusal_message) ) |
|
|
|
con.commit() |
|
|
|
return jsonify(refusal_message) |
|
|
|
|
|
|
|