Update stats when is_allowed_entry has changed

This commit is contained in:
Tanner Collin 2021-09-22 03:19:08 +00:00
parent 520d11c236
commit e75cd254d8

View File

@ -233,6 +233,11 @@ class AdminMemberSerializer(MemberSerializer):
] ]
def update(self, instance, validated_data): 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: if 'precix_cnc_cert_date' in validated_data:
changed = validated_data['precix_cnc_cert_date'] != instance.precix_cnc_cert_date changed = validated_data['precix_cnc_cert_date'] != instance.precix_cnc_cert_date
if changed: if changed: