derek-wds / uh-backend Goto Github PK
View Code? Open in Web Editor NEWThis project forked from uni-health/uh-backend
Guys, time to work! Feel free to contribute!
This project forked from uni-health/uh-backend
Guys, time to work! Feel free to contribute!
When a simple log is added to the database, /get/log
no longer works. Here is the server error:
127.0.0.1 - - [01/Dec/2019 22:38:12] "POST /get/log HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 816, in configure_subclass_mapper
sub_mapper = mapper.polymorphic_map[discriminator]
KeyError: 'simple'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
return original_handler(e)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/_compat.py", line 34, in reraise
raise value.with_traceback(tb)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
return original_handler(e)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/_compat.py", line 34, in reraise
raise value.with_traceback(tb)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_restful/__init__.py", line 458, in wrapper
resp = resource(*args, **kwargs)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/views.py", line 88, in view
return self.dispatch_request(*args, **kwargs)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_restful/__init__.py", line 573, in dispatch_request
resp = meth(*args, **kwargs)
File "/Users/fred/Development/UH-backend/config/auth.py", line 14, in dec
return f(*args, **kwargs)
File "/Users/fred/Development/UH-backend/resources/getPatientLog.py", line 41, in post
logs = Log.query.filter_by(patient_phone=phone).all()
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3168, in all
return list(self)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 105, in instances
util.raise_from_cause(err)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 399, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 154, in reraise
raise value
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 85, in instances
rows = [proc(row) for row in fetch]
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 85, in <listcomp>
rows = [proc(row) for row in fetch]
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 839, in polymorphic_instance
_instance = polymorphic_instances[discriminator]
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/util/_collections.py", line 734, in __missing__
self[key] = val = self.creator(key)
File "/Users/fred/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 819, in configure_subclass_mapper
"No such polymorphic_identity %r is defined" % discriminator
AssertionError: No such polymorphic_identity 'simple' is defined
When testing something on my end, I discovered server error when the user tries to access an API (specifically /get/data
) without being logged in
127.0.0.1 - - [01/Dec/2019 18:21:17] "POST /get/data HTTP/1.1" 500 -
Traceback (most recent call last):
...
File "/Users/fred/Development/UH-backend/config/auth.py", line 12, in dec
return UNAUTHORIZED
NameError: name 'UNAUTHORIZED' is not defined
Here are some things that I thought of that we need to do (I will update it when I think of more)
In the log table and medicine table, we have columns for doctors' names and patients' names. We shouldn't do this! If the doctor or patient changes their name, then the table becomes out of date.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.