From e75cd254d85706aa1b732c2d7bbfe4cfbe133da4 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Wed, 22 Sep 2021 03:19:08 +0000 Subject: [PATCH] Update stats when is_allowed_entry has changed --- apiserver/apiserver/api/serializers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apiserver/apiserver/api/serializers.py b/apiserver/apiserver/api/serializers.py index 0b32422..ac52fb9 100644 --- a/apiserver/apiserver/api/serializers.py +++ b/apiserver/apiserver/api/serializers.py @@ -233,6 +233,11 @@ class AdminMemberSerializer(MemberSerializer): ] def update(self, instance, validated_data): + if 'is_allowed_entry' in validated_data: + changed = validated_data['is_allowed_entry'] != instance.is_allowed_entry + if changed: + utils_stats.changed_card() + if 'precix_cnc_cert_date' in validated_data: changed = validated_data['precix_cnc_cert_date'] != instance.precix_cnc_cert_date if changed: