Skip to content

Commit

Permalink
Run black
Browse files Browse the repository at this point in the history
  • Loading branch information
eadpearce committed Sep 23, 2021
1 parent 884515b commit 71af920
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
12 changes: 5 additions & 7 deletions api/compliance/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ def get_compliance_site_case(pk):
def case_meets_conditions_for_compliance(case: Case):
if case.case_type.id == CaseTypeEnum.SIEL.id:
if settings.FEATURE_SIEL_COMPLIANCE_ENABLED:
if (
Good.objects.filter(
goods_on_application__application_id=case.id,
control_list_entries__rating__regex=COMPLIANCE_CASE_ACCEPTABLE_GOOD_CONTROL_CODES,
goods_on_application__licence__quantity__isnull=False,
).exists()
):
if Good.objects.filter(
goods_on_application__application_id=case.id,
control_list_entries__rating__regex=COMPLIANCE_CASE_ACCEPTABLE_GOOD_CONTROL_CODES,
goods_on_application__licence__quantity__isnull=False,
).exists():
return True
return False
elif case.case_type.id in [CaseTypeEnum.OIEL.id, CaseTypeEnum.OICL.id, *CaseTypeEnum.OPEN_GENERAL_LICENCE_IDS]:
Expand Down
4 changes: 1 addition & 3 deletions api/compliance/tests/test_compliance_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ def tests_siel_good_control_code(self, control_code, exists):
def tests_siel_no_compliance_feature_flag_off(self):
case = self.create_standard_application_case(self.organisation)

good = GoodFactory(
organisation=self.organisation, is_good_controlled=True, control_list_entries=["ML22"],
)
good = GoodFactory(organisation=self.organisation, is_good_controlled=True, control_list_entries=["ML22"],)
GoodOnLicenceFactory(
good=GoodOnApplicationFactory(application=case, good=good),
licence=LicenceFactory(case=case),
Expand Down

0 comments on commit 71af920

Please sign in to comment.