Skip to content

Commit

Permalink
Merge pull request #119 from DSACMS/fix-logic-syntax
Browse files Browse the repository at this point in the history
Fix Error In Report Generation
  • Loading branch information
IsaacMilarky authored Apr 9, 2024
2 parents fe85530 + cacd321 commit 7222035
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/gen_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,13 @@ def get_heading_report_values(headings, oss_entity):
# +--------------+--------------------------------------+---+-------------------+


and_conditional = (raw_diff > 0 and
(behavior == DesiredReportBehavior.VALUE_INCREASE.value))
and_conditional = ((raw_diff>0) and (behavior == DesiredReportBehavior.VALUE_INCREASE.value))
#Use a XOR by using the != operator
if raw_diff > 0 != (behavior == DesiredReportBehavior.VALUE_INCREASE.value):
if (raw_diff > 0) != (behavior == DesiredReportBehavior.VALUE_INCREASE.value):
if raw_diff < 0:
# Red color
diff_color = 'color: #d31c08'
elif and_conditional or (raw_diff < 0 and not and_conditional):
elif and_conditional or ((raw_diff < 0) and not and_conditional):
# Green color
diff_color = 'color: #45c527'

Expand Down

0 comments on commit 7222035

Please sign in to comment.