Display the recorder of each Transaction

This commit is contained in:
Tanner Collin 2021-09-23 21:04:18 +00:00
parent 26f581b449
commit c2ea455750
2 changed files with 11 additions and 0 deletions

View File

@ -66,6 +66,7 @@ class TransactionSerializer(serializers.ModelSerializer):
'User Flagged', 'User Flagged',
], allow_null=True, required=False) ], allow_null=True, required=False)
number_of_membership_months = serializers.IntegerField(max_value=36, min_value=-36) number_of_membership_months = serializers.IntegerField(max_value=36, min_value=-36)
recorder = serializers.SerializerMethodField()
class Meta: class Meta:
model = models.Transaction model = models.Transaction
@ -99,6 +100,12 @@ class TransactionSerializer(serializers.ModelSerializer):
member = models.Member.objects.get(id=obj.member_id) member = models.Member.objects.get(id=obj.member_id)
return member.preferred_name + ' ' + member.last_name return member.preferred_name + ' ' + member.last_name
def get_recorder(self, obj):
if obj.recorder:
return obj.recorder.username
else:
return None
# member viewing other members # member viewing other members
# hide info for non-vetted members so someone sitting # hide info for non-vetted members so someone sitting

View File

@ -374,6 +374,10 @@ class TransactionTable extends React.Component {
<Table.Cell>Memo:</Table.Cell> <Table.Cell>Memo:</Table.Cell>
<Table.Cell>{transaction.memo}</Table.Cell> <Table.Cell>{transaction.memo}</Table.Cell>
</Table.Row> </Table.Row>
<Table.Row>
<Table.Cell>Recorder:</Table.Cell>
<Table.Cell>{transaction.recorder || 'System'}</Table.Cell>
</Table.Row>
{!!transaction.report_type && <Table.Row> {!!transaction.report_type && <Table.Row>
<Table.Cell>Report Type:</Table.Cell> <Table.Cell>Report Type:</Table.Cell>