app/soc/logic/models/role.py
changeset 1976 be994529deee
parent 1956 1fcddf90eccc
child 2072 eb4565a8e5b4
equal deleted inserted replaced
1975:e9bc96529849 1976:be994529deee
    43     """
    43     """
    44 
    44 
    45     super(Logic, self).__init__(model, base_model=base_model,
    45     super(Logic, self).__init__(model, base_model=base_model,
    46                                 scope_logic=scope_logic)
    46                                 scope_logic=scope_logic)
    47 
    47 
    48     self.dissalow_last_resign = disallow_last_resign
    48     self.disallow_last_resign = disallow_last_resign
    49 
    49 
    50 
    50 
    51   def getGroupEntityFromScopePath(self, group_logic, scope_path):
    51   def getGroupEntityFromScopePath(self, group_logic, scope_path):
    52     """Returns a group entity by using the given scope_path.
    52     """Returns a group entity by using the given scope_path.
    53     
    53     
   100     Returns:
   100     Returns:
   101       - None if the entity is allowed to resign.
   101       - None if the entity is allowed to resign.
   102       - Error message otherwise.
   102       - Error message otherwise.
   103     """
   103     """
   104 
   104 
   105     if self.dissalow_last_resign:
   105     if self.disallow_last_resign:
   106      # check if this is the last active role for it's scope
   106      # check if this is the last active role for it's scope
   107      fields = {'scope': entity.scope,
   107      fields = {'scope': entity.scope,
   108           'status': 'active'}
   108           'status': 'active'}
   109      roles = self.getForFields(fields, limit=2)
   109      roles = self.getForFields(fields, limit=2)
   110 
   110