diff --git a/lemarche/siaes/models.py b/lemarche/siaes/models.py index b90ef1ffd..36997b06d 100644 --- a/lemarche/siaes/models.py +++ b/lemarche/siaes/models.py @@ -1033,7 +1033,7 @@ def source_display(self): return "l'ASP" @property - def completion_percent(self): + def completion_rate_calculated(self): score, total = 0, 0 for key, value in siae_constants.SIAE_COMPLETION_SCORE_GRID.items(): completion_item_kind = value[siae_constants.COMPLETION_KIND_KEY] diff --git a/lemarche/siaes/tests.py b/lemarche/siaes/tests.py index 6a2c804b8..dd153a965 100644 --- a/lemarche/siaes/tests.py +++ b/lemarche/siaes/tests.py @@ -134,7 +134,7 @@ def test_is_missing_contact_property(self): def test_is_missing_content_property(self): siae_missing: Siae = SiaeFactory(name="Ma boite", contact_email="") - score_completion_before = siae_missing.completion_percent + score_completion_before = siae_missing.completion_rate_calculated self.assertTrue(siae_missing.is_missing_content) siae_full: Siae = SiaeFactory( name="Ma boite", @@ -143,15 +143,15 @@ def test_is_missing_content_property(self): contact_phone="0000000000", description="test", ) - self.assertTrue(score_completion_before < siae_full.completion_percent) - score_completion_before = siae_full.completion_percent + self.assertTrue(score_completion_before < siae_full.completion_rate_calculated) + score_completion_before = siae_full.completion_rate_calculated sector = SectorFactory() siae_full.sectors.add(sector) SiaeOfferFactory(siae=siae_full) SiaeLabelOldFactory(siae=siae_full) siae_full.save() # to update stats self.assertFalse(siae_full.is_missing_content) - self.assertTrue(score_completion_before < siae_full.completion_percent) + self.assertTrue(score_completion_before < siae_full.completion_rate_calculated) siae_full_2: Siae = SiaeFactory( name="Ma boite", diff --git a/lemarche/templates/dashboard/_siae_tab_content.html b/lemarche/templates/dashboard/_siae_tab_content.html index 5a4d5d17c..ab00a9939 100644 --- a/lemarche/templates/dashboard/_siae_tab_content.html +++ b/lemarche/templates/dashboard/_siae_tab_content.html @@ -12,7 +12,7 @@

{{ siae.name_display }}

- {% include "includes/_completion_progress_bar.html" with completion_percent=siae.completion_percent %} + {% include "includes/_completion_progress_bar.html" with completion_percent=siae.completion_rate_calculated %}