-
Notifications
You must be signed in to change notification settings - Fork 164
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
Badge not changing between super user and staff user. #300
Comments
@summerthe This is something what I already checked multiple times and it was always working for me BUT maybe I'm missing something. In our demo application at https://demo.unfoldadmin.com there is a badge in sidebar which is changing on each reload so the dynamic loading works at least in our demo. Would you mind to check our demo repository https://github.com/unfoldadmin/formula and try to replicate the issue there? If there is a problem, I can take a look. |
@lukasvinclav I was able to replicate the same issue in the formula. I forked the formula and updated the badge callback to return a random integer or UUID based on the user type. For staff user login, use the following username/password: demostaff/demostaff. Check code here: The callback's return value is changing, and it is possible that the
|
@lukasvinclav same issue, looks like it depends on Also noticed that def badge_callback(request):
if request.user:
return str(request.user.id)
return '' But using this callback with def environment_callback(request):
if request.user:
return [str(request.user.id), 'warning' ]
return '' |
@jSdmeman @summerthe thank you very much for the report. Now, I was able to replicate the issue locally. I created new PR #342 fixing the issue. Would you mind to test it locally if it works for you? |
@lukasvinclav just tested in local, it fixes the issue. |
@lukasvinclav thanks for so fast answer |
I created a repository and recorded a video to demonstrate that badge values are not changing between users. The values only update when the server restarts and then get cached for the user.
Steps to reproduce:
Here is repo link: https://github.com/summerthe/unfold-demo
@lukasvinclav Let me know if you need anything else to reproduce this issue.
The text was updated successfully, but these errors were encountered: