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