Skip to content

Commit

Permalink
Check if priority is set before assinging to issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kostajh committed Jan 28, 2013
1 parent 38b2c83 commit 7d56646
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bugwarrior/services/activecollab2.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def find_issues(self, user_id=None, project_id=None, project_name=None):

try:
for key, task in enumerate(user_tasks_data):
log.debug('analyzing task data')
task_count += 1
assigned_task = dict()
if task[u'type'] == 'Ticket':
Expand All @@ -71,7 +72,10 @@ def find_issues(self, user_id=None, project_id=None, project_name=None):
assigned_task['type'] = "ticket"
assigned_task['created_on'] = ticket_data[u'created_on']
assigned_task['created_by_id'] = ticket_data[u'created_by_id']
assigned_task['priority'] = self.format_priority(ticket_data[u'priority'])
if 'priority' in ticket_data:
assigned_task['priority'] = self.format_priority(ticket_data[u'priority'])
else:
assigned_task['priority'] = self.default_priority
if 'due_on' in ticket_data:
assigned_task['due'] = self.format_date(ticket_data[u'due_on'])
else:
Expand All @@ -88,7 +92,10 @@ def find_issues(self, user_id=None, project_id=None, project_name=None):
assigned_task['type'] = "task"
assigned_task['created_on'] = task[u'created_on']
assigned_task['created_by_id'] = task[u'created_by_id']
assigned_task['priority'] = self.format_priority(task[u'priority'])
if 'priority' in ticket_data:
assigned_task['priority'] = self.format_priority(task[u'priority'])
else:
assigned_task['priority'] = self.default_priority
if 'due_on' in task:
assigned_task['due'] = self.format_date(task[u'due_on'])
else:
Expand All @@ -106,7 +113,6 @@ def call_api(self, uri, get=None):
global api_count
api_count += 1
url = self.url.rstrip("/") + "?token=" + self.key + "&path_info=" + uri + "&format=json"
log.debug("API request: %s" % url)
req = urllib2.Request(url)
res = urllib2.urlopen(req)

Expand Down

0 comments on commit 7d56646

Please sign in to comment.