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

href missing in compact sidebar if user only has view permission #61

Closed
cdelacombaz opened this issue Nov 21, 2022 · 1 comment
Closed

Comments

@cdelacombaz
Copy link

Versions
Django==4.1.3
django-jet-reboot=1.3.3

Description

If a django project is set up with JET_SIDE_MENU_COMPACT = True and a staff member has only a view access for a certain model, the href is missing from the sidebar item.

Screenshot 2022-11-21 at 17 32 52

In jet/utils/get_app_list the url only gets added to the model, if a user has change or add permission:
https://github.com/assem-ch/django-jet-reboot/blob/master/jet/utils.py#L85

I'd be happy to contribute and write a PR for this. But can someone tell me if it's as easy as I think or what should be done?

Would modifying the existing code as following be ok?

if perms.get('view', False) or perms.get('change', False) :
    try:
        model_dict['admin_url'] = reverse('admin:%s_%s_changelist' % info, current_app=admin_site.name)
    except NoReverseMatch:
        pass
@cdelacombaz
Copy link
Author

oh damn, didn't find an issue but just saw after submitting that a PR is already open! :)

#29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant