diff --git a/CDC_Backend/APIs/adminViews.py b/CDC_Backend/APIs/adminViews.py index 22869aa..cb28744 100644 --- a/CDC_Backend/APIs/adminViews.py +++ b/CDC_Backend/APIs/adminViews.py @@ -254,6 +254,7 @@ def submitApplication(request, id, email, user_type): } subject = STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT.format(company_name=opening.company_name) application.changed_by = get_object_or_404(User, id=id) + application.save() sendEmail(student_user.email, subject, data, STUDENT_APPLICATION_SUBMITTED_TEMPLATE) return Response({'action': "Add Student Application", 'message': "Application added"}, status=status.HTTP_200_OK) diff --git a/CDC_Backend/APIs/models.py b/CDC_Backend/APIs/models.py index 2b577ab..8580029 100644 --- a/CDC_Backend/APIs/models.py +++ b/CDC_Backend/APIs/models.py @@ -10,7 +10,7 @@ from .constants import * class User(models.Model): - email = models.EmailField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT, unique=True, primary_key=True) + email = models.EmailField(primary_key=True, blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT) id = models.CharField(blank=False, max_length=25, db_index=True) user_type = ArrayField(models.CharField(blank=False, max_length=10), size=4, default=list, blank=False) last_login_time = models.DateTimeField(default=timezone.now)