Rename CNC cert to Tormach, add Precix CNC cert

This commit is contained in:
Tanner Collin 2021-09-08 05:24:05 +00:00
parent e1aea8efcf
commit 996e063014
5 changed files with 27 additions and 9 deletions

View File

@ -51,7 +51,8 @@ class Member(models.Model):
mill_cert_date = models.DateField(blank=True, null=True, default=None) mill_cert_date = models.DateField(blank=True, null=True, default=None)
wood_cert_date = models.DateField(blank=True, null=True, default=None) wood_cert_date = models.DateField(blank=True, null=True, default=None)
wood2_cert_date = models.DateField(blank=True, null=True, default=None) wood2_cert_date = models.DateField(blank=True, null=True, default=None)
cnc_cert_date = models.DateField(blank=True, null=True, default=None) tormach_cnc_cert_date = models.DateField(blank=True, null=True, default=None)
precix_cnc_cert_date = models.DateField(blank=True, null=True, default=None)
rabbit_cert_date = models.DateField(blank=True, null=True, default=None) rabbit_cert_date = models.DateField(blank=True, null=True, default=None)
trotec_cert_date = models.DateField(blank=True, null=True, default=None) trotec_cert_date = models.DateField(blank=True, null=True, default=None)
paused_date = models.DateField(blank=True, null=True) paused_date = models.DateField(blank=True, null=True)

View File

@ -180,7 +180,8 @@ class MemberSerializer(serializers.ModelSerializer):
'mill_cert_date', 'mill_cert_date',
'wood_cert_date', 'wood_cert_date',
'wood2_cert_date', 'wood2_cert_date',
'cnc_cert_date', 'tormach_cnc_cert_date',
'precix_cnc_cert_date',
'rabbit_cert_date', 'rabbit_cert_date',
'trotec_cert_date', 'trotec_cert_date',
] ]

View File

@ -261,7 +261,11 @@ class TrainingViewSet(Base, Retrieve, Create, Update):
elif session.course.id == 283: elif session.course.id == 283:
member.mill_cert_date = utils.today_alberta_tz() if status == 'Attended' else None member.mill_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
elif session.course.id == 259: elif session.course.id == 259:
member.cnc_cert_date = utils.today_alberta_tz() if status == 'Attended' else None member.tormach_cnc_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
elif session.course.id == 428:
member.precix_cnc_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
# TODO: change group membership
elif session.course.id == 247: elif session.course.id == 247:
member.rabbit_cert_date = utils.today_alberta_tz() if status == 'Attended' else None member.rabbit_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
@ -477,7 +481,8 @@ class LockoutViewSet(viewsets.ViewSet, List):
authorization['mill'] = bool(member.mill_cert_date) and authorization['common'] authorization['mill'] = bool(member.mill_cert_date) and authorization['common']
authorization['wood'] = bool(member.wood_cert_date) and authorization['common'] authorization['wood'] = bool(member.wood_cert_date) and authorization['common']
authorization['wood2'] = bool(member.wood2_cert_date) and authorization['common'] authorization['wood2'] = bool(member.wood2_cert_date) and authorization['common']
authorization['cnc'] = bool(member.cnc_cert_date) and authorization['common'] authorization['tormach_cnc'] = bool(member.tormach_cnc_cert_date) and authorization['common']
authorization['precix_cnc'] = bool(member.precix_cnc_cert_date) and authorization['common']
active_member_cards[card.card_number] = authorization active_member_cards[card.card_number] = authorization

View File

@ -669,10 +669,16 @@ export function AdminMemberCertifications(props) {
<Table.Cell><AdminCert name='Mill' field='mill_cert_date' {...props} /></Table.Cell> <Table.Cell><AdminCert name='Mill' field='mill_cert_date' {...props} /></Table.Cell>
</Table.Row> </Table.Row>
<Table.Row> <Table.Row>
<Table.Cell>CNC</Table.Cell> <Table.Cell>Tormach CNC</Table.Cell>
<Table.Cell>{member.cnc_cert_date ? 'Yes, ' + member.cnc_cert_date : 'No'}</Table.Cell> <Table.Cell>{member.tormach_cnc_cert_date ? 'Yes, ' + member.tormach_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/259'>Tormach: CAM and Tormach Intro</Link></Table.Cell> <Table.Cell><Link to='/courses/259'>Tormach: CAM and Tormach Intro</Link></Table.Cell>
<Table.Cell><AdminCert name='CNC' field='cnc_cert_date' {...props} /></Table.Cell> <Table.Cell><AdminCert name='Tormach CNC' field='tormach_cnc_cert_date' {...props} /></Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Precix CNC</Table.Cell>
<Table.Cell>{member.precix_cnc_cert_date ? 'Yes, ' + member.precix_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/428'>Basic CNC Wood Router</Link></Table.Cell>
<Table.Cell><AdminCert name='Precix CNC' field='precix_cnc_cert_date' {...props} /></Table.Cell>
</Table.Row> </Table.Row>
<Table.Row> <Table.Row>
<Table.Cell>Rabbit Laser</Table.Cell> <Table.Cell>Rabbit Laser</Table.Cell>

View File

@ -53,10 +53,15 @@ export function CertList(props) {
<Table.Cell><Link to='/courses/283'>Metal: Manual Mill & Advanced Lathe</Link></Table.Cell> <Table.Cell><Link to='/courses/283'>Metal: Manual Mill & Advanced Lathe</Link></Table.Cell>
</Table.Row> </Table.Row>
<Table.Row> <Table.Row>
<Table.Cell>CNC {MoreCert('Tormach metal CNC, CNC wood router.')}</Table.Cell> <Table.Cell>Tormach CNC</Table.Cell>
<Table.Cell>{member.cnc_cert_date ? 'Yes, ' + member.cnc_cert_date : 'No'}</Table.Cell> <Table.Cell>{member.tormach_cnc_cert_date ? 'Yes, ' + member.tormach_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/259'>Tormach: CAM and Tormach Intro</Link></Table.Cell> <Table.Cell><Link to='/courses/259'>Tormach: CAM and Tormach Intro</Link></Table.Cell>
</Table.Row> </Table.Row>
<Table.Row>
<Table.Cell>Precix CNC</Table.Cell>
<Table.Cell>{member.precix_cnc_cert_date ? 'Yes, ' + member.precix_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/428'>Basic CNC Wood Router</Link></Table.Cell>
</Table.Row>
<Table.Row> <Table.Row>
<Table.Cell>Rabbit Laser</Table.Cell> <Table.Cell>Rabbit Laser</Table.Cell>
<Table.Cell>{member.rabbit_cert_date ? 'Yes, ' + member.rabbit_cert_date : 'No'}</Table.Cell> <Table.Cell>{member.rabbit_cert_date ? 'Yes, ' + member.rabbit_cert_date : 'No'}</Table.Cell>