-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/BE-36: User Level #364
Conversation
Correct me if I'm wrong but in order for someone's level to be calculated, he needs to make an API request, right? I think that would be better to update it regularly whenever the related user's profile is visited (when |
|
By overhead, do you mean the time consumed by calculating user's level every time his profile is visited? I think, waiting for users to update their levels by clicking on a button is not really user-friendly. Also, I don't think couple of calculations will hurt the performance. Right now, the bottleneck in our application is the AWS itself (fetching images or uploading). So I don't really feel like anyone will complain about the time wasted by these calculations :D |
|
|
Tested the API and the level calculation. Everything seems ok, thanks for the efforts. (Since we integrated the level calculation into profile, I can't see where new API will be used though) |
Perhaps, if we want to change when we check level update. |
Created an API for calculating user level.
Initially created a function inside User model. But then moved the logic to API function since the prior led to circular import error.
The level is calculated using number of art items and comments the user and user's visits to other art items and user profiles. (In varying degrees of importance)
Currently I chose a low threshold, since we don't have a lot of data, but we can update this later.
Tested through postman and admin site.
Documented with swagger.