Example #1
0
 def __init__(self, *args, **kwargs):
     super(GroupForm, self).__init__(*args, **kwargs)
     group = kwargs.get('instance', None)
     if group:
         self.fields['roles'].initial = [
             role.id for role in get_global_roles(group)
         ]
Example #2
0
 def __init__(self, *args, **kwargs):
     super(UserChangeForm, self).__init__(*args, **kwargs)
     user = kwargs.get('instance', None)
     if user:
         self.fields['roles'].initial = [
             role.id for role in get_global_roles(user)
         ]
Example #3
0
 def __init__(self, *args, **kwargs):
     super(GroupForm, self).__init__(*args, **kwargs)
     group = kwargs.get('instance', None)
     if group:
         self.fields['roles'].initial = [role.id for role in get_global_roles(group)]
Example #4
0
 def __init__(self, *args, **kwargs):
     super(UserChangeForm, self).__init__(*args, **kwargs)
     user = kwargs.get('instance', None)
     if user:
         self.fields['roles'].initial = [role.id for role in get_global_roles(user)]