Fix Protocoin bug for new signups crashing portal

This commit is contained in:
Tanner Collin 2022-08-24 01:47:37 +00:00
parent 8347826d57
commit c88d5add1f

View File

@ -254,7 +254,7 @@ class MemberSerializer(serializers.ModelSerializer):
def get_protocoin(self, obj):
transactions = obj.user.transactions
total = transactions.aggregate(Sum('protocoin'))['protocoin__sum']
total = transactions.aggregate(Sum('protocoin'))['protocoin__sum'] or 0
return total
def update(self, instance, validated_data):