added a option on course

This commit is contained in:
Prince Kurt Laurence 2024-01-24 22:38:59 +08:00
parent 4a9c81fd34
commit 2d75066884
7 changed files with 15 additions and 14 deletions

View file

@ -22,6 +22,7 @@ class CustomUser(AbstractUser):
('BS Food Technology', 'BS Food Technology'),
('BS Applied Physics', 'BS Applied Physics'),
('BS Environmental Science', 'BS Environmental Science'),
('Not Applicable', 'Not Applicable'),
)
course = models.CharField(

View file

@ -54,7 +54,7 @@ class EquipmentInstance(models.Model):
return super().save(*args, **kwargs)
seed_database = False
seed_database = True
@receiver(post_migrate)

View file

@ -1211,8 +1211,8 @@ components:
email:
type: string
format: email
readOnly: true
title: Email address
maxLength: 254
first_name:
type: string
maxLength: 100
@ -1220,22 +1220,29 @@ components:
nullable: true
oneOf:
- $ref: '#/components/schemas/CourseEnum'
- $ref: '#/components/schemas/BlankEnum'
- $ref: '#/components/schemas/NullEnum'
section:
type: string
nullable: true
maxLength: 60
last_name:
type: string
maxLength: 100
is_teacher:
type: boolean
readOnly: true
is_technician:
type: boolean
readOnly: true
required:
- course
- email
- first_name
- id
- is_teacher
- is_technician
- last_name
- section
- username
Equipment:
type: object
@ -1486,8 +1493,8 @@ components:
email:
type: string
format: email
readOnly: true
title: Email address
maxLength: 254
first_name:
type: string
maxLength: 100
@ -1495,18 +1502,20 @@ components:
nullable: true
oneOf:
- $ref: '#/components/schemas/CourseEnum'
- $ref: '#/components/schemas/BlankEnum'
- $ref: '#/components/schemas/NullEnum'
section:
type: string
nullable: true
maxLength: 60
last_name:
type: string
maxLength: 100
is_teacher:
type: boolean
readOnly: true
is_technician:
type: boolean
readOnly: true
PatchedEquipment:
type: object
properties:
@ -1589,8 +1598,6 @@ components:
type: string
format: date-time
readOnly: true
section:
type: string
SendEmailReset:
type: object
properties:
@ -1707,13 +1714,10 @@ components:
type: string
format: date-time
readOnly: true
section:
type: string
required:
- borrower
- equipments
- id
- section
- subject
- teacher
- timestamp
@ -1743,10 +1747,6 @@ components:
properties:
username:
type: string
description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
only.
pattern: ^[\w.@+-]+$
maxLength: 150
email:
type: string
format: email