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

"Error: Undefined" when creating or deleting controller profile #49

Closed
petelking opened this issue Dec 3, 2020 · 2 comments · Fixed by #51
Closed

"Error: Undefined" when creating or deleting controller profile #49

petelking opened this issue Dec 3, 2020 · 2 comments · Fixed by #51
Assignees
Labels
bug Something isn't working
Milestone

Comments

@petelking
Copy link

petelking commented Dec 3, 2020

after controller profile creation:

[2020-12-03 14:07:07,722] {hxtool_api} {Thread-30} INFO - New controller profile added
[2020-12-03 14:07:07,723] {app} {Thread-30} ERROR - Exception on /api/v1/profile [PUT]
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/usrer/HX/HXTool-master/hxtool_api.py", line 3004, in profile
return make_response_by_code(200)
File "/Users/user/HX/HXTool-master/hxtool_util.py", line 69, in make_response_by_code
return (json.dumps(code_table.get(code)), code)
NameError: name 'json' is not defined

And After controller profile Deletion:

[2020-12-03 14:07:36,738] {hxtool_api} {Thread-35} INFO - Controller profile 1faf43ad-2110-49fb-87eb-459b71c3ddc3 deleted.
[2020-12-03 14:07:36,738] {app} {Thread-35} ERROR - Exception on /api/v1/profile/1faf43ad-2110-49fb-87eb-459b71c3ddc3 [DELETE]
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/user/HX/HXTool-master/hxtool_api.py", line 3025, in profile_by_id
return make_response_by_code(200)
File "/Users/user/HX/HXTool-master/hxtool_util.py", line 69, in make_response_by_code
return (json.dumps(code_table.get(code)), code)
NameError: name 'json' is not defined

Note that Creation and Deletion are both successful.

@B0fH B0fH added the bug Something isn't working label Dec 3, 2020
@B0fH B0fH self-assigned this Dec 3, 2020
@B0fH
Copy link
Contributor

B0fH commented Dec 3, 2020

Hi @petelking -
Thanks for the note, much appreciated! Yes, this is indeed a bug. I've fixed it in my branch and it will be merged into master on my next pull request. See f16040d

In the meantime, you can simply add the import to the top of hxtool_util.py and restart HXTool.

Thanks,
Elazar

@B0fH B0fH linked a pull request Dec 29, 2020 that will close this issue
@B0fH B0fH added this to the 4.7 milestone Dec 29, 2020
@B0fH
Copy link
Contributor

B0fH commented May 4, 2021

Closing as 4.7 has been released.

@B0fH B0fH closed this as completed May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants