-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Everything should now be working on the new api format. Added some ab…
…ility to add Organizations and products.
- Loading branch information
1 parent
3b64417
commit 4ac3cfc
Showing
29 changed files
with
1,354 additions
and
1,175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ app/db/files/* | |
app/redis/data/* | ||
app/.env | ||
specs | ||
app/api/main/controller/prod_server_db_creds.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from view.response import error_message | ||
from model.connector import get_session | ||
|
||
def execute_query(custom_response, stm): | ||
raw_data = [] | ||
|
||
# Connect to the database | ||
try: | ||
session = get_session() | ||
except Exception: | ||
error = error_message() | ||
custom_response.insert_flash_message(error) | ||
custom_response.set_status_code(500) | ||
return custom_response, raw_data, False | ||
|
||
# Execute the query | ||
try: | ||
stream = session.execute(stm) | ||
raw_data = stream.all() | ||
except Exception: | ||
error = error_message() | ||
custom_response.insert_flash_message(error) | ||
custom_response.set_status_code(400) | ||
session.close() | ||
return custom_response, raw_data, False | ||
|
||
session.close() | ||
return custom_response, raw_data, True |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.