HUE-2693 [core] sync_groups_on_login drops groups from other users when a new user logs in

Review Request #5134 - Created April 15, 2015 and submitted

Chris Conner
hue
HUE-1071
HUE-2693
7a973d8...
hue
enricoberti, erickt, romain
commit 1c22c21d8309a2bf76915c45ba32fe2d297a2c98
Author: Chris Conner <cconner@cloudera.com>
Date:   Wed Apr 15 14:51:14 2015 -0400

    HUE-2693 [core] sync_groups_on_login drops groups from other users when a new user logs in

:100644 000000 616cc17... 0000000... D	apps/useradmin/src/useradmin/views.py.orig


  • 1
  • 0
  • 0
  • 0
  • 1
Description From Last Updated
Would the problem be here instead? i.e. we need to remove the Groups objects with no users outside of this ... Romain Rigaux
  1. 
      
  2. apps/useradmin/src/useradmin/views.py (Diff revision 2)
     
     

    Would the problem be here instead?

    i.e. we need to remove the Groups objects with no users outside of this loop?

    1. So I tried moving the delete outside of the for loop instead of the original change in this patch and it didn't resolve the issue.

    2. Just in case:

      I am not 100% sure about the logic are we trying to delete the Group that don't have a LDAP Group globally anymore?

      e.g.
      from django.db.models import Count
      Group.objects.annotate(num_ldap_group=Count('group')).filter(num_ldap_group=0).delete()

      But that might not be enough for #593, #594, #591

      If you are 100% confident about your change go ahead, if not I can look a bit more tomorrow!

  3. 
      
Review request changed

Status: Closed (submitted)

Loading...