-
Notifications
You must be signed in to change notification settings - Fork 83
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
[SDESK-7464] - Create new async Users Resource and Service #2799
base: async
Are you sure you want to change the base?
Conversation
@MarkLark86 a few questions :
|
|
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.
Looks good, just a couple small things then this one should be good to go
@@ -0,0 +1,3 @@ | |||
from .users import UsersResourceModel |
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.
There is also a superdesk.tests file, which this module overrides causing an exception to be raised when running the app.
Could you move the content of that original file to this one, and delete the old one as well please
class UsersAsyncService(AsyncResourceService[UsersResourceModel]): | ||
_updating_stage_visibility = True | ||
|
||
async def __is_invalid_operation( |
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.
After further inspection, looks like this one is not needed here either, as it is in the context of an API request.
It's functions like these should not go into these new async resource services, but instead the REST API (when we implement the User one).
We want to keep the separation of concerns with the new code, by separating out the data and request layers specifically. This should help keep these two concerns smaller, easier to read etc
email = user_dict.get("email") | ||
username = user_dict.get("username") | ||
tokenDoc = {"user": user_id, "email": email} | ||
id = resetService.store_reset_password_token(tokenDoc, email, activate_ttl, user_id) |
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.
id
shadows the built-in function with the same name. It would be good not to use names that are built into the python language
Purpose
This PR creates new async users resource and service:
Solves: SDESK-7464