Exemple #1
0
 def recipients_filter(self, user):
     roles = user.user_data.get('role', [])
     if not roles and not user_has_reporting_location(user):
         return False
     return any([
         role != IN_CHARGE_ROLE for role in user.user_data.get('role', [])
     ])
Exemple #2
0
    def get_message(self, recipient):
        user = recipient.owner
        if not user_has_reporting_location(user) or not get_two_way_number_for_recipient(user):
            return

        message, kwargs = self.get_message_for_location(user.location)
        if not message:
            return
        kwargs['name'] = user.name
        return message % kwargs
    def get_message(self, recipient):
        user = recipient.owner
        if not user_has_reporting_location(user) or not user.get_verified_number():
            return

        message, kwargs = self.get_message_for_location(user.location)
        if not message:
            return
        kwargs['name'] = user.name
        return message % kwargs
 def recipients_filter(self, user):
     roles = user.user_data.get('role', [])
     if not roles and not user_has_reporting_location(user):
         return False
     return any([role != IN_CHARGE_ROLE for role in user.user_data.get('role', [])])