Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New User throwing error #181

Open
mertbagt opened this issue Oct 12, 2022 · 2 comments
Open

Add New User throwing error #181

mertbagt opened this issue Oct 12, 2022 · 2 comments

Comments

@mertbagt
Copy link
Collaborator

127.0.0.1 - - [12/Oct/2022 11:43:07] "POST /api/users/create HTTP/1.1" 500 -
Traceback (most recent call last):
File "C:\Users\Merritt\miniconda3\Lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\Merritt\miniconda3\Lib\site-packages\flask\app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "C:\Projects\codefordc\us-congress-pizza-flag-tracker\src\user\user_controller.py", line 15, in create_user
new_user = UserActions.create(userParams)
File "C:\Projects\codefordc\us-congress-pizza-flag-tracker\src\user\user_actions.py", line 32, in create
new_user = UserModel(user_values)
File "", line 4, in init

File "C:\Users\Merritt\miniconda3\Lib\site-packages\sqlalchemy\orm\state.py", line 480, in initialize_instance
manager.dispatch.init_failure(self, args, kwargs)
File "C:\Users\Merritt\miniconda3\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 70, in exit
compat.raise
(
File "C:\Users\Merritt\miniconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_
raise exception
File "C:\Users\Merritt\miniconda3\Lib\site-packages\sqlalchemy\orm\state.py", line 477, in _initialize_instance
return manager.original_init(*mixed[1:], **kwargs)
File "C:\Projects\codefordc\us-congress-pizza-flag-tracker\src\user\user_model.py", line 49, in init
self.manage_all_orders = user_values.manage_all_orders
AttributeError: 'UserParams' object has no attribute 'manage_all_orders'

@mertbagt
Copy link
Collaborator Author

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Merritt\miniconda3\Lib\site-packages\flask\app.py", line 2091, in call
return self.wsgi_app(environ, start_response)
File "C:\Users\Merritt\miniconda3\Lib\site-packages\flask\app.py", line 2076, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\Merritt\AppData\Roaming\Python\Python39\site-packages\flask_cors\extension.py", line 165,
in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\Merritt\miniconda3\Lib\site-packages\flask\app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\Merritt\miniconda3\Lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\Merritt\AppData\Roaming\Python\Python39\site-packages\flask_cors\extension.py", line 165,
in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\Merritt\miniconda3\Lib\site-packages\flask\app.py", line 1393, in handle_user_exception
return self.ensure_sync(handler)(e)
File "C:\Projects\codefordc\us-congress-pizza-flag-tracker\src\error_handler.py", line 35, in handle_exceptions_for_app
if type(e.code) in (int, float):
AttributeError: 'AttributeError' object has no attribute 'code'

@thadk
Copy link
Collaborator

thadk commented Nov 10, 2022

We may want to add these to frontend submission form but I added them to the backend temporarily: { "manage_all_orders": "Y", "update_all_statuses": "Y", "view_all_orders": "Y", "manage_all_users": "Y", "manage_office_users": "Y", "update_own_password": "Y"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants