added field for offer acceptance

This commit is contained in:
Kovilapu Karthik Karthik 2023-06-11 00:06:36 +05:30
parent fb7d0550fe
commit fecb2f3593
6 changed files with 14 additions and 3 deletions

3
.gitignore vendored
View File

@ -140,3 +140,6 @@ dmypy.json
.idea
*.pyc
dev.env
#vscode settings
.vscode/

View File

@ -194,7 +194,7 @@ def addPlacement(request):
'%d-%m-%Y').date()
# Only Allowing Fourth Year for Placement
opening.allowed_batch = [2017, 2018, 2019, 2020, 2021]
opening.allowed_batch = [FOURTH_YEAR,]
# Check if allowed_branch are valid
if data[ALLOWED_BRANCH] is None:
raise ValueError('Allowed Branch cannot be empty')

View File

@ -66,7 +66,7 @@ SUPER_ADMIN = 's_admin'
COMPANY = 'company'
TIER = 'tier'
# To be Configured Properly
FOURTH_YEAR = '2019'
FOURTH_YEAR = '2020'
MAX_OFFERS_PER_STUDENT = 2
MAX_RESUMES_PER_STUDENT = 3
EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours

View File

@ -221,6 +221,7 @@ class PlacementApplication(models.Model):
resume = models.CharField(max_length=JNF_TEXT_MAX_CHARACTER_COUNT, blank=False, null=True, default=None)
additional_info = models.JSONField(blank=True, null=True, default=None)
selected = models.BooleanField(null=True, default=None, blank=True)
offer_accepted = models.BooleanField(null=True, default=None, blank=True) # True if offer accepted, False if rejected, None if not yet decided
applied_at = models.DateTimeField(blank=False, default=None, null=True)
updated_at = models.DateTimeField(blank=False, default=None, null=True)
changed_by = models.ForeignKey(User, blank=False, on_delete=models.RESTRICT, default=None, null=True)

View File

@ -11,4 +11,5 @@ urlpatterns = [
path("submitApplication/", studentViews.submitApplication, name="Submit Application"),
path("deleteApplication/", studentViews.deleteApplication, name="Delete Application"),
path("getContributorStats/", studentViews.getContributorStats, name="Get Contributor Stats"),
path("studentAcceptOffer/", studentViews.studentAcceptOffer, name="Student Accept Offer"),
]

View File

@ -247,3 +247,9 @@ def getContributorStats(request, id, email, user_type):
return Response({'action': "Get Contributor Stats", 'message': "Something Went Wrong"},
status=status.HTTP_400_BAD_REQUEST)
#view for sudentAcceptOffer
@api_view(['POST'])
@isAuthorized(allowed_users=[STUDENT])
def studentAcceptOffer(request, id, email, user_type):
None