Skip to content

Commit

Permalink
Skip not unique issues
Browse files Browse the repository at this point in the history
Do not add to stats if the issue is already appended.
For example multiple comments on one issue.
  • Loading branch information
Maros Kopec committed Oct 20, 2017
1 parent 81294d5 commit 9067843
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions did/plugins/sentry.py
Expand Up @@ -96,8 +96,12 @@ def fetch(self):
for activity in self.filter_data():
if (activity['user']['email'] == self.user.email and
activity['type'] == 'set_resolved'):
self.stats.append("{0} - {1}".format(
activity['issue']['shortId'], activity['issue']['title']))
record = "{0} - {1}".format(
activity['issue']['shortId'], activity['issue']['title'])
# skip if the issue is in the stats already
if record in self.stats:
continue
self.stats.append(record)


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -112,8 +116,12 @@ def fetch(self):
for activity in self.filter_data():
if (activity['user']['email'] == self.user.email and
activity['type'] == 'note'):
self.stats.append("{0} - {1}".format(
activity['issue']['shortId'], activity['issue']['title']))
record = "{0} - {1}".format(
activity['issue']['shortId'], activity['issue']['title'])
# skip if the issue is in the stats already
if record in self.stats:
continue
self.stats.append(record)


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 9067843

Please sign in to comment.