bugfix: name clashing- importing datetime as dt
This commit is contained in:
parent
a12b2f2a2c
commit
9b1d70ba29
|
@ -1,8 +1,11 @@
|
|||
import json
|
||||
from datetime import datetime
|
||||
from datetime import datetime as dt
|
||||
|
||||
from rest_framework.decorators import api_view
|
||||
|
||||
from django.shortcuts import render
|
||||
from django.forms.models import model_to_dict
|
||||
|
||||
from .serializers import *
|
||||
from .utils import *
|
||||
|
||||
|
@ -72,8 +75,8 @@ def getDashboard(request, id, email, user_type):
|
|||
|
||||
placements = Placement.objects.filter(allowed_batch__contains=[studentDetails.batch],
|
||||
allowed_branch__contains=[studentDetails.branch],
|
||||
deadline_datetime__gte=datetime.now(),
|
||||
offer_accepted=True, email_verified=True).order_by('deadline_datetime')
|
||||
deadline_datetime__gte=dt.now(),
|
||||
).order_by('deadline_datetime')
|
||||
placementsdata = PlacementSerializerForStudent(placements, many=True).data
|
||||
|
||||
placementApplications = PlacementApplication.objects.filter(student_id=id)
|
||||
|
@ -140,7 +143,7 @@ def submitApplication(request, id, email, user_type):
|
|||
opening = get_object_or_404(Placement, id=data[OPENING_ID],
|
||||
allowed_batch__contains=[student.batch],
|
||||
allowed_branch__contains=[student.branch],
|
||||
deadline_datetime__gte=datetime.now().date()
|
||||
deadline_datetime__gte=dt.now().date()
|
||||
)
|
||||
if not opening.offer_accepted or not opening.email_verified:
|
||||
raise PermissionError("Placement Not Approved")
|
||||
|
|
Loading…
Reference in New Issue