Link to member pages in the Instructor Attendance panel
This commit is contained in:
parent
de68fd79b7
commit
d5b8ffa0e2
|
@ -340,6 +340,7 @@ class TrainingSerializer(serializers.ModelSerializer):
|
||||||
session = serializers.PrimaryKeyRelatedField(queryset=models.Session.objects.all())
|
session = serializers.PrimaryKeyRelatedField(queryset=models.Session.objects.all())
|
||||||
student_name = serializers.SerializerMethodField()
|
student_name = serializers.SerializerMethodField()
|
||||||
student_email = serializers.SerializerMethodField()
|
student_email = serializers.SerializerMethodField()
|
||||||
|
student_id = serializers.SerializerMethodField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Training
|
model = models.Training
|
||||||
|
@ -360,6 +361,12 @@ class TrainingSerializer(serializers.ModelSerializer):
|
||||||
member = models.Member.objects.get(id=obj.member_id)
|
member = models.Member.objects.get(id=obj.member_id)
|
||||||
return member.old_email
|
return member.old_email
|
||||||
|
|
||||||
|
def get_student_id(self, obj):
|
||||||
|
if obj.user:
|
||||||
|
return obj.user.member.id
|
||||||
|
else:
|
||||||
|
return obj.member_id
|
||||||
|
|
||||||
|
|
||||||
class StudentTrainingSerializer(TrainingSerializer):
|
class StudentTrainingSerializer(TrainingSerializer):
|
||||||
attendance_status = serializers.ChoiceField(['Waiting for payment', 'Withdrawn'])
|
attendance_status = serializers.ChoiceField(['Waiting for payment', 'Withdrawn'])
|
||||||
|
|
|
@ -99,7 +99,10 @@ function AttendanceRow(props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='attendance-row'>
|
<div className='attendance-row'>
|
||||||
<p>{student.student_name}{student.attendance_status === 'Waiting for payment' && ' (Waiting for payment)'}:</p>
|
<p>
|
||||||
|
<Link to={'/members/'+student.student_id}>{student.student_name}</Link>
|
||||||
|
{student.attendance_status === 'Waiting for payment' && ' (Waiting for payment)'}:
|
||||||
|
</p>
|
||||||
|
|
||||||
<Button {...makeProps('Withdrawn')}>
|
<Button {...makeProps('Withdrawn')}>
|
||||||
Withdrawn
|
Withdrawn
|
||||||
|
|
Loading…
Reference in New Issue
Block a user