Browse Source

Only treat a group as new if there are no existing hashes

David Cramer 10 years ago
parent
commit
96b5ed2c0d
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/sentry/event_manager.py

+ 2 - 4
src/sentry/event_manager.py

@@ -372,6 +372,8 @@ class EventManager(object):
         # attempt to find a matching hash
         existing_hashes = self._find_hashes(project, hashes)
 
+        is_new = not existing_hashes
+
         try:
             existing_group_id = (h[0] for h in existing_hashes if h[0]).next()
         except StopIteration:
@@ -387,13 +389,9 @@ class EventManager(object):
                 checksum=hashes[0],
                 defaults=kwargs,
             )
-
-            is_new = True
         else:
             group = Group.objects.get(id=existing_group_id)
 
-            is_new = False
-
         new_hashes = [h[1] for h in existing_hashes if h[0] is None]
         if new_hashes:
             affected = GroupHash.objects.filter(