-
Notifications
You must be signed in to change notification settings - Fork 84
Migrate Notifications server to python #198 #526
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
base: master
Are you sure you want to change the base?
Conversation
response.raise_for_status() | ||
result = await response.json() | ||
|
||
if result.get('status') != 'OK': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is a good idea. Since we're using HTTP, the client should rely on appropriate status codes - for example, 401 (Unauthorized). Instead of checking a JSON field, we should check the status code, especially since those fields can be somewhat opaque. Therefore, refactoring views.py
would be a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you. I wanted only to rewrite the node.js server without changing anything else, but assuming that no one else uses this endpoint it should be changed.
Migrated the server. Used socketify.py for high performance WebSockets. The server configuration variables and deployment remain the same. Additionally the server is now tested using the normal Django test suite.