Merge branch 'main' into final_changes

This commit is contained in:
karthik mv 2022-05-23 23:16:31 +05:30 committed by GitHub
commit b19ea638cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 20 deletions

View File

@ -1,11 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"

2
.gitignore vendored
View File

@ -130,6 +130,8 @@ dmypy.json
/venv/ /venv/
/.github/ /.github/
./CDC_Backend/static
./CDC_Backend/Storage
/CDC_Backend/CDC_Backend/__pycache__/ /CDC_Backend/CDC_Backend/__pycache__/
/CDC_Backend/APIs/__pycache__/ /CDC_Backend/APIs/__pycache__/
/CDC_Backend/APIs/migrations/ /CDC_Backend/APIs/migrations/

View File

@ -18,7 +18,13 @@ def markStatus(request, id, email, user_type):
application = applications.filter(student__roll_no=i[STUDENT_ID]) # Filtering student's application application = applications.filter(student__roll_no=i[STUDENT_ID]) # Filtering student's application
if len(application) > 0: if len(application) > 0:
application = application[0] application = application[0]
application.selected = True if i[STUDENT_SELECTED] == "true" else False if not application.selected:
if i[STUDENT_SELECTED] == True:
application.selected = True
else:
application.selected = False
else:
raise ValueError("Student already selected")
email = str(application.student.roll_no) + "@iitdh.ac.in" # Only allowing for IITDh emails email = str(application.student.roll_no) + "@iitdh.ac.in" # Only allowing for IITDh emails
subject = STUDENT_APPLICATION_STATUS_TEMPLATE_SUBJECT.format( subject = STUDENT_APPLICATION_STATUS_TEMPLATE_SUBJECT.format(
@ -53,10 +59,10 @@ def markStatus(request, id, email, user_type):
def getDashboard(request, id, email, user_type): def getDashboard(request, id, email, user_type):
try: try:
placements = Placement.objects.all().order_by('-created_at') placements = Placement.objects.all().order_by('-created_at')
ongoing = placements.filter(deadline_datetime__gt=datetime.datetime.now(), offer_accepted=True) ongoing = placements.filter(deadline_datetime__gt=datetime.datetime.now(), offer_accepted=True, email_verified=True)
previous = placements.exclude(deadline_datetime__gt=datetime.datetime.now()).filter( previous = placements.exclude(deadline_datetime__gt=datetime.datetime.now()).filter(
offer_accepted=True) offer_accepted=True, email_verified=True)
new = placements.filter(offer_accepted__isnull=True) new = placements.filter(offer_accepted__isnull=True, email_verified=True)
ongoing = PlacementSerializerForAdmin(ongoing, many=True).data ongoing = PlacementSerializerForAdmin(ongoing, many=True).data
previous = PlacementSerializerForAdmin(previous, many=True).data previous = PlacementSerializerForAdmin(previous, many=True).data
new = PlacementSerializerForAdmin(new, many=True).data new = PlacementSerializerForAdmin(new, many=True).data
@ -159,8 +165,8 @@ def updateAdditionalInfo(request, id, email, user_type):
except ValueError: except ValueError:
return Response({'action': "Update Additional Info", 'message': "Additional Info must be a list"}, return Response({'action': "Update Additional Info", 'message': "Additional Info must be a list"},
status=status.HTTP_400_BAD_REQUEST) status=status.HTTP_400_BAD_REQUEST)
except: except Exception as e:
logger.warning("Update Additional Info: " + str(sys.exc_info())) logger.warning("Update Additional Info: " + str(e))
return Response({'action': "Update Additional Info", 'message': "Something went wrong"}, return Response({'action': "Update Additional Info", 'message': "Something went wrong"},
status=status.HTTP_400_BAD_REQUEST) status=status.HTTP_400_BAD_REQUEST)
@ -209,7 +215,6 @@ def submitApplication(request, id, email, user_type):
raise AttributeError(i + " not found in Additional Info") raise AttributeError(i + " not found in Additional Info")
else: else:
additional_info[i] = data[ADDITIONAL_INFO][i] additional_info[i] = data[ADDITIONAL_INFO][i]
application.additional_info = json.dumps(additional_info) application.additional_info = json.dumps(additional_info)
application.save() application.save()
return Response({'action': "Add Student Application", 'message': "Application added"}, return Response({'action': "Add Student Application", 'message': "Application added"},

View File

@ -10,9 +10,9 @@ Django==3.2.12
django-background-tasks==1.2.5 django-background-tasks==1.2.5
django-compat==1.0.15 django-compat==1.0.15
django-cors-headers==3.11.0 django-cors-headers==3.11.0
django-db-logger==0.1.11 django-db-logger==0.1.12
djangorestframework==3.13.1 djangorestframework==3.13.1
google-auth==2.6.3 google-auth==2.6.6
gunicorn==20.1.0 gunicorn==20.1.0
idna==3.3 idna==3.3
importlib-metadata==4.11.3 importlib-metadata==4.11.3