Skip to content

Commit

Permalink
fix ring change logic (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoumayaMauthoorMOJ authored Jul 26, 2024
1 parent b912aca commit f147548
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions manage_discussions/get_discussions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,24 @@
assessment = details['labels']['edges'][0]['node']['name']
if assessment in ring_index:
ring = ring_index[assessment]
ring_change = None
ring_change = 0
ring_old = blips_old.get(details['title'])
if ring_old is not None:
ring_change = ring_old - ring
else:

if ring_old is None:
ring_change = 2
entries_new.append({"label":details['title'],
"quadrant":quadrant,
"ring":ring,
"moved":ring_change,
else:
ring_diff = ring_old - ring
if ring_diff > 0:
ring_change = 1
elif ring_diff < 0:
ring_change = -1

entries_new.append({"label": details['title'],
"quadrant": quadrant,
"ring": ring,
"moved": ring_change,
"link": details['url'],
"active":True
"active": True
})

else:
Expand Down

0 comments on commit f147548

Please sign in to comment.