question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: allow toggling sharing for user/group on and off

See original GitHub issue

Hello!

I have custom User model, which inherits AbstractBaseUser and doesn’t have Group relation. So when i use filter mixin, i get this exception:

Traceback (most recent call last):
  File "python2.7/site-packages/advanced_filters/admin.py", line 34, in lookups
    return AdvancedFilter.objects.filter_by_user(request.user).filter(
  File "python2.7/site-packages/advanced_filters/models.py", line 13, in filter_by_user
    return self.filter(Q(users=user) | Q(groups__in=user.groups.all()))
  File "python2.7/site-packages/django/utils/functional.py", line 235, in inner
    return func(self._wrapped, *args)
AttributeError: 'User' object has no attribute 'groups'

Can you add a attribute checking in UserLookupManager.filter_by_user or something?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gitaarikcommented, Sep 30, 2021

I created a PR for it. It was easy enough. I want to use this plugin maybe. I’ve been playing around with it. It’s quite nice, however a bit complex to use. Ok for developers but more complex for managers.

But I understand that it’s not easy to make a user-friendly UI in the Django admin. It’s not great but with a bit of modification and plugins it is just good enough to not make a custom admin yourself. At least it saves some work for as long as it suffices.

So thanks for the plugin. I hope this PR is will be accepted and that the plugin will be accessible to more people. Maybe I’ll do some more hacking on this some time.

Cheers

1reaction
asfaltboycommented, Sep 28, 2017

Yep that’s a good idea, and we should also allow toggling the sharing (and related filtering) for user/group in settings.

P.s: Pull requests are welcome 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature: Manage Subnets left pane allow toggle "Groups" on and off ...
We use groups to organize subnets in logical groups. However, sometimes you are just looking for a subnet. A button that would toggle...
Read more >
Windows 365 feature requests - Microsoft Tech Community
Windows 365 feature requests · Allow non-admins to restart their own Cloud PC from inside the OS · Option for Azure AD join...
Read more >
Allow user to enable/disable instance level Shared Runners ...
The Enable shared runners for this group toggle switch will always be visible. The default value is for the switch to be in...
Read more >
Feature Requests: Hot (424 ideas) – Horizon Worlds
Please develop a Keyboard Gizmo to allow us to give users the ability to enter text. This could be either a gizmo that...
Read more >
New Feature Request for Board Permissions
For example, we have shared boards that a third party is using to feed us information, and I want my team members to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found