Skip to content

Commit

Permalink
Update this field via management command
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 28, 2023
1 parent 086705d commit af83872
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clevercloud/siaes_update_count_fields.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ fi
cd $APP_HOME

# django-admin update_siae_count_fields
django-admin update_siae_count_fields --fields etablissement_count
django-admin update_siae_count_fields --fields etablissement_count --fields completion_rate
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"label_count",
"image_count",
"etablissement_count",
"completion_rate",
]


Expand Down Expand Up @@ -67,6 +68,8 @@ def handle(self, *args, **options):
# etablissement_count
if siae.is_active and siae.siren:
siae.etablissement_count = siae_utils.calculate_etablissement_count(siae)
# completion_rate
siae.completion_rate = siae.completion_rate_calculated

# Step 3: update count fields
siae.save(update_fields=update_fields)
Expand Down

0 comments on commit af83872

Please sign in to comment.