Esempio n. 1
0
 def _subscribe_and_assign_issue(self, acting_user, group, result):
     if acting_user:
         GroupSubscription.objects.subscribe(
             user=acting_user,
             group=group,
             reason=GroupSubscriptionReason.status_change,
         )
         self_assign_issue = UserOption.objects.get_value(
             user=acting_user, key='self_assign_issue', default='0')
         if self_assign_issue == '1' and not group.assignee_set.exists():
             result['assignedTo'] = Actor(type=User, id=acting_user.id)
Esempio n. 2
0
def self_subscribe_and_assign_issue(acting_user, group):
    # Used during issue resolution to assign to acting user
    # returns None if the user didn't elect to self assign on resolution
    # or the group is assigned already, otherwise returns Actor
    # representation of current user
    if acting_user:
        GroupSubscription.objects.subscribe(
            user=acting_user, group=group, reason=GroupSubscriptionReason.status_change
        )
        self_assign_issue = UserOption.objects.get_value(
            user=acting_user, key="self_assign_issue", default="0"
        )
        if self_assign_issue == "1" and not group.assignee_set.exists():
            return Actor(type=User, id=acting_user.id)