Addded ctf platform Flask app with basic auth functions register, login, logout Added ctf platform database design (MySQL Workbench) Added forward engineered SQL file Added wsgi startup script Installed various python dependencies README.md Updated .gitignore Updated
11 lines
464 B
Python
11 lines
464 B
Python
def build_response_dict(success, action, message, reason=None):
|
|
response_dict = {}
|
|
if success:
|
|
response_dict['data'] = { action: 'success', 'message': message}
|
|
if reason is not None:
|
|
response_dict['data']['reason'] = reason
|
|
elif not success:
|
|
response_dict['error'] = { action: 'failed', 'message': message}
|
|
if reason is not None:
|
|
response_dict['error']['reason'] = reason
|
|
return response_dict |