Compare commits
136 Commits
941018c127
...
d728fc90db
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | d728fc90db | |
Jaya Surya P | 90f028651d | |
NitinVangipuram | 3d42366e50 | |
NitinVangipuram | 95d7689a4c | |
Jaya Surya P | 642ad8e326 | |
NitinVangipuram | 8aa7246ec9 | |
Jaya Surya P | e184d2af53 | |
NitinVangipuram | e717cbc6e6 | |
NitinVangipuram | e242fff9a7 | |
Jaya Surya P | 4c248be3a5 | |
Jaya Surya P | 7eee78177c | |
NitinVangipuram | ce97fc8342 | |
Jaya Surya P | a6ec89f1c6 | |
NitinVangipuram | b977053556 | |
NitinVangipuram | c7a5325ed6 | |
Jaya Surya P | 5e53859f52 | |
NitinVangipuram | 48ffebb221 | |
Jaya Surya P | c89cae549f | |
NitinVangipuram | 020a10f71a | |
NitinVangipuram | bab382c8ec | |
CDC | bd4fbdc49a | |
Vangipuram Nitin | 60ed13588c | |
NitinVangipuram | 18c3d9b046 | |
NitinVangipuram | 32fb8c5d6a | |
Jaya Surya | c2ebf5a600 | |
Jaya Surya | aac7bf55d1 | |
Jaya Surya P | 18f509e6a4 | |
NitinVangipuram | 93b716ec90 | |
NitinVangipuram | 6e68db7760 | |
Jaya Surya P | 48b59248e6 | |
NitinVangipuram | 727c53ef85 | |
Jaya Surya P | 7f2e4d24dd | |
Vangipuram Nitin | 6a46dc0dcd | |
NitinVangipuram | 9990cdfa5a | |
NitinVangipuram | 280d4a599f | |
NitinVangipuram | 1ac94e4faf | |
NitinVangipuram | 32a52f9567 | |
Jaya Surya P | e7c6249734 | |
Sreenivasu Akella | 0e64af83a4 | |
Jaya Surya P | 390e582075 | |
CDC | 1b3f9bb383 | |
NitinVangipuram | 6cf27e52a4 | |
Eshwar | dcb85afea4 | |
Eshwar | 0be1a6c56e | |
Jaya Surya | c95c3bb631 | |
Jaya Surya | bf42c17c3a | |
Jaya Surya | 10cc08dc4d | |
karthik mv | 9447654979 | |
uttamthummala | b6a7dd055a | |
uttamthummala | 48a5d7c417 | |
uttamthummala | 595461f33b | |
karthik mv | b3f9e2835d | |
karthikmurakonda | 3d3584ab8e | |
uttamthummala | 0e65eb4e63 | |
karthikmurakonda | c298e313e2 | |
karthikmurakonda | 3819d3d7ed | |
uttamthummala | f1018b8fac | |
uttamthummala | 6e95741397 | |
karthik mv | 9b14023f35 | |
karthikmurakonda | 7c3d4f9e4d | |
uttamthummala | 6c484c1292 | |
karthik mv | 72c6187d0d | |
uttamthummala | f6d27a9e5a | |
uttamthummala | 1c3103ed4a | |
uttamthummala | 8fe297c490 | |
karthikmurakonda | cdf1e7bf19 | |
karthik mv | 484e1130e8 | |
karthik mv | 8981627dee | |
karthik mv | bc6f89addd | |
uttamthummala | 11f58558a8 | |
uttamthummala | e05c4761a4 | |
karthik mv | 7ef5c9aac4 | |
uttamthummala | 8d97183dd3 | |
karthik mv | 10050cc4e9 | |
karthikmurakonda | 0963ceaaa5 | |
karthikmurakonda | c2fdb3a59c | |
uttamthummala | 5901f0ea37 | |
uttamthummala | e428602ed5 | |
uttamthummala | 9e95da5e03 | |
uttamthummala | 4734834ad5 | |
karthikmurakonda | 34ec430468 | |
karthikmurakonda | 1038dcf5b8 | |
karthik mv | f55316e351 | |
karthik mv | e702f70627 | |
karthik mv | d5c22e760f | |
karthikmurakonda | 158851f6e4 | |
uttamthummala | a86778b64d | |
karthik mv | f4a55b1d60 | |
karthikmurakonda | 7615713213 | |
karthikmurakonda | 59b88201d3 | |
karthikmurakonda | d78aec241a | |
karthikmurakonda | 497b7f0a3c | |
karthikmurakonda | 32870efd18 | |
uttamthummala | 729d3ef59a | |
karthikmurakonda | 653755d4c9 | |
karthikmurakonda | 83b8a772c3 | |
karthikmurakonda | 41adfa3796 | |
karthikmurakonda | 12ec9619a6 | |
karthikmurakonda | df0fe95dcc | |
karthikmurakonda | e09273d008 | |
karthikmurakonda | 830602144c | |
karthikmurakonda | 79b14703f4 | |
karthikmurakonda | 613d0b9d3f | |
karthikmurakonda | fb5f85b237 | |
karthikmurakonda | 405d3a55ff | |
karthikmurakonda | 4a9b3ab3b0 | |
karthikmurakonda | 0914c0c2a6 | |
karthikmurakonda | c9cb9957f4 | |
karthikmurakonda | 4d63afedf5 | |
karthikmurakonda | 6a677e931a | |
karthikmurakonda | 186bab832c | |
uttamthummala | 95e6b0c2f3 | |
uttamthummala | 3363aa7d79 | |
uttamthummala | 8c6f6dc17d | |
uttamthummala | a9177417f7 | |
uttamthummala | 814ed005f1 | |
uttamthummala | 32de7eebb5 | |
uttamthummala | 195b9e8037 | |
uttamthummala | 8518bf0ba0 | |
uttamthummala | 17299b1861 | |
uttamthummala | 59c1a0a59e | |
uttamthummala | 37615876d6 | |
uttamthummala | 62033249e9 | |
uttamthummala | 7ccac2a2f2 | |
uttamthummala | ed6f313b68 | |
uttamthummala | 5d0f9fba58 | |
uttamthummala | 1378898d37 | |
karthik mv | 7fc18bb2fb | |
Kovilapu Karthik Karthik | 11b74f6b3c | |
karthik mv | 202c145550 | |
karthikmurakonda | 99f6e921ee | |
karthik mv | 0a979eb05e | |
Kovilapu Karthik Karthik | 95a91be90b | |
karthik mv | 3748d48c2b | |
karthikmurakonda | 6d924c15ef | |
dependabot[bot] | 811ff9b38f |
|
@ -0,0 +1,64 @@
|
||||||
|
name: Django CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
env:
|
||||||
|
HOSTING_URL: "http://localhost:8000/"
|
||||||
|
DEBUG: True
|
||||||
|
EMAIL: karthik.murakonda14@gmail.com
|
||||||
|
EMAIL_PASSWORD: 1234567890
|
||||||
|
EMAIL_VERIFICATION_SECRET_KEY: "b'<\xa3\xaf&d6\xa9sf\x19$\x96\xb7\x90\x8b\x88\x84\x0e\x191\xde,M\x90\x17(\xf7\nG\x13\x8d$\x9f&\xb0\xcd\xa4\xaf\xa9\x1b\x15\x02B\x8a\xaf\xff\x0c\x1e\xd5\xb3\x06\xb8\xa6\x9bQ\xa0TR\xe8\x98\x9ae\xe0n}\xcc/[\xdaFz\x18\xfeX\xaf\xbd\xd0\x88\xeal\xe3\xd2\xe3\xb8\x8c\x199{\xf3<\xb0\xc5\xd0\xe7*Rv\xda\xbb \x1d\x85~\xff%>\x1e\xb8\xa7\xbf\xbc\xb2\x06\x86X\xc3\x9f\x13<\x9fd\xea\xb5\x01\xa4\x7f\xa0\x1b\x8bO\x01h\xe8\xfd\x1f\xfe\xba\xbeg\\\xc2\xcb\xc3\xd1~\xff\xd5/9d\xa8\xa7x{\x16\xdb\\\xbb\x08\rI\xcd\x9e7\x8c~\x0f\x1d\x81rXZD\xf0\xf7\x87K\x8f\xfb,\xf4\xf0\xa5\x9e\xde^\xca\xae\x80|9b\x9b\xaaE\xba\xfb\xdf\x80\xb1\x99\x83e[\xf8\xce&Rq\x99\xdb}\xeeO\xd5\x18\x8d\x0bv\xe7\xab\xf9\xb9{\xb5u\xce\xcf\x90\xa6HE\xc5\x92p\x00\x158\xdf'"
|
||||||
|
DB_NAME: cdc
|
||||||
|
DB_USER: postgres
|
||||||
|
DB_PASSWORD: postgres
|
||||||
|
DB_HOST: localhost
|
||||||
|
DB_PORT: 5432
|
||||||
|
RECAPTCHA_SECRET_KEY: 6LfpadYhAAAAAJUIJQ_JJqkqq3arvalwkVCgW3nG
|
||||||
|
GOOGLE_OAUTH_CLIENT_ID: 628308091838-nvfn455vabbq7j0odd797sls8itpplmr.apps.googleusercontent.com
|
||||||
|
SECRET_KEY: 9%2e!&f6(ib^690y48z)&w6fczhwukzzp@3y*^*7u+7%4s-mie
|
||||||
|
GOOGLE_OAUTH_CLIENT_SECRET: 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
|
||||||
|
REFRESH_TOKEN: 1//0gCf5fxAgSqNcCgYIARAAGBASNwF-L9IrIWxWwqmboeJkEzVn0sqxbaeyWXODE5s24V7pSdiAzFM2cxOUC9XT_xp7t_60o3JMfOg
|
||||||
|
EMAIL_ID: 200010030@iitdh.ac.in
|
||||||
|
ROLL_NO: 200010030
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: cdc
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
max-parallel: 4
|
||||||
|
matrix:
|
||||||
|
python-version: [3.9]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
cd CDC_Backend
|
||||||
|
python manage.py collectstatic
|
||||||
|
python manage.py makemigrations
|
||||||
|
python manage.py makemigrations APIs
|
||||||
|
python manage.py test
|
|
@ -129,8 +129,8 @@ dmypy.json
|
||||||
|
|
||||||
|
|
||||||
/venv/
|
/venv/
|
||||||
/.github/
|
|
||||||
./CDC_Backend/static
|
./CDC_Backend/static
|
||||||
|
CDC_Backend/static_url*
|
||||||
./CDC_Backend/Storage
|
./CDC_Backend/Storage
|
||||||
/CDC_Backend/CDC_Backend/__pycache__/
|
/CDC_Backend/CDC_Backend/__pycache__/
|
||||||
/CDC_Backend/APIs/__pycache__/
|
/CDC_Backend/APIs/__pycache__/
|
||||||
|
@ -144,4 +144,5 @@ dmypy.json
|
||||||
dev.env
|
dev.env
|
||||||
|
|
||||||
#vscode settings
|
#vscode settings
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.DS_Store
|
BIN
CDC_Backend.zip
BIN
CDC_Backend.zip
Binary file not shown.
Binary file not shown.
|
@ -83,7 +83,7 @@ class Student(StudentAdmin):
|
||||||
class PlacementResources(resources.ModelResource):
|
class PlacementResources(resources.ModelResource):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Placement
|
model = Placement
|
||||||
exclude = ('id','changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
exclude = ('changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
||||||
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf')
|
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf')
|
||||||
class AdminAdmin(ExportMixin, SimpleHistoryAdmin):
|
class AdminAdmin(ExportMixin, SimpleHistoryAdmin):
|
||||||
resource_class = PlacementResources
|
resource_class = PlacementResources
|
||||||
|
@ -92,7 +92,7 @@ class AdminAdmin(ExportMixin, SimpleHistoryAdmin):
|
||||||
class PlacementResources(resources.ModelResource):
|
class PlacementResources(resources.ModelResource):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Placement
|
model = Placement
|
||||||
exclude = ('id', 'changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
exclude = ( 'changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
||||||
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf')
|
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf')
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ class AdminAdmin(ExportMixin, SimpleHistoryAdmin):
|
||||||
class PlacementResources(resources.ModelResource):
|
class PlacementResources(resources.ModelResource):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Placement
|
model = Placement
|
||||||
exclude = ('id', 'changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
exclude = ('changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
||||||
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf')
|
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf')
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,6 +138,13 @@ class PlacementApplicationResources(resources.ModelResource):
|
||||||
class PlacementAdmin(ExportMixin, SimpleHistoryAdmin):
|
class PlacementAdmin(ExportMixin, SimpleHistoryAdmin):
|
||||||
resource_class = PlacementApplicationResources
|
resource_class = PlacementApplicationResources
|
||||||
|
|
||||||
|
class InternshipApplicationResources(resources.ModelResource):
|
||||||
|
class Meta:
|
||||||
|
model = InternshipApplication
|
||||||
|
exclude = ('id', 'changed_by')
|
||||||
|
class InternshipApplicationAdmin(ExportMixin, SimpleHistoryAdmin):
|
||||||
|
resource_class = InternshipApplicationResources
|
||||||
|
|
||||||
|
|
||||||
@admin.register(PlacementApplication)
|
@admin.register(PlacementApplication)
|
||||||
class PlacementApplication(PlacementAdmin):
|
class PlacementApplication(PlacementAdmin):
|
||||||
|
@ -151,7 +158,18 @@ class PlacementApplication(PlacementAdmin):
|
||||||
|
|
||||||
def Student(self, obj):
|
def Student(self, obj):
|
||||||
return model_admin_url(obj.student)
|
return model_admin_url(obj.student)
|
||||||
|
@admin.register(InternshipApplication)
|
||||||
|
class InternshipApplication(InternshipApplicationAdmin):
|
||||||
|
list_display = ('id', 'Internship', 'Student', 'selected')
|
||||||
|
search_fields = ('id',)
|
||||||
|
ordering = ('id',)
|
||||||
|
list_filter = ('selected',)
|
||||||
|
|
||||||
|
def Internship(self, obj):
|
||||||
|
return model_admin_url(obj.internship)
|
||||||
|
|
||||||
|
def Student(self, obj):
|
||||||
|
return model_admin_url(obj.student)
|
||||||
|
|
||||||
class PrePlacementResources(resources.ModelResource):
|
class PrePlacementResources(resources.ModelResource):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -178,7 +196,7 @@ class InternshipResources(resources.ModelResource):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Internship
|
model = Internship
|
||||||
exclude = ('id', 'changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
exclude = ('id', 'changed_by', 'is_company_details_pdf', 'is_description_pdf',
|
||||||
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf')
|
'is_stipend_details_pdf', 'is_selection_procedure_details_pdf')
|
||||||
|
|
||||||
|
|
||||||
class InternAdmin(ExportMixin, SimpleHistoryAdmin):
|
class InternAdmin(ExportMixin, SimpleHistoryAdmin):
|
||||||
|
@ -199,3 +217,12 @@ class Placement(InternAdmin):
|
||||||
search_fields = (COMPANY_NAME, CONTACT_PERSON_NAME)
|
search_fields = (COMPANY_NAME, CONTACT_PERSON_NAME)
|
||||||
ordering = ('updated_at', COMPANY_NAME, CONTACT_PERSON_NAME, 'stipend')
|
ordering = ('updated_at', COMPANY_NAME, CONTACT_PERSON_NAME, 'stipend')
|
||||||
|
|
||||||
|
@admin.register(Issues)
|
||||||
|
class Issues(admin.ModelAdmin):
|
||||||
|
list_display = ('id', 'title', 'description')
|
||||||
|
search_fields = ('id', 'title', 'description')
|
||||||
|
ordering = ('id', 'title', 'description')
|
||||||
|
# list_filter = ('status',)
|
||||||
|
|
||||||
|
def Student(self, obj):
|
||||||
|
return model_admin_url(obj.student)
|
||||||
|
|
|
@ -13,7 +13,9 @@ urlpatterns = [
|
||||||
path('getApplications/', adminViews.getApplications, name="Get Applications"),
|
path('getApplications/', adminViews.getApplications, name="Get Applications"),
|
||||||
path("submitApplication/", adminViews.submitApplication, name="Submit Application"),
|
path("submitApplication/", adminViews.submitApplication, name="Submit Application"),
|
||||||
path('generateCSV/', adminViews.generateCSV, name="Generate CSV"),
|
path('generateCSV/', adminViews.generateCSV, name="Generate CSV"),
|
||||||
|
path('downloadResume/', adminViews.downloadResume, name="Download Resume"),
|
||||||
path('addPPO/', adminViews.addPPO, name="Add PPO"),
|
path('addPPO/', adminViews.addPPO, name="Add PPO"),
|
||||||
path('getStudentApplication/', adminViews.getStudentApplication, name="Get student application"),
|
path('getStudentApplication/', adminViews.getStudentApplication, name="Get student application"),
|
||||||
path('getStats/', adminViews.getStats, name="Get Stats"),
|
path('getStats/', adminViews.getStats, name="Get Stats"),
|
||||||
|
path('getEligibleStudents/', adminViews.get_eligible_students, name="Get Eligible Students"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import csv
|
import csv
|
||||||
|
import zipfile
|
||||||
|
|
||||||
from rest_framework.decorators import api_view
|
from rest_framework.decorators import api_view
|
||||||
|
|
||||||
|
@ -12,8 +13,14 @@ from .utils import *
|
||||||
def markStatus(request, id, email, user_type):
|
def markStatus(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
# Getting all application from db for this opening
|
if OPENING_TYPE in data:
|
||||||
applications = PlacementApplication.objects.filter(placement_id=data[OPENING_ID])
|
opening_type= data[OPENING_TYPE] #not to break the code
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
applications = InternshipApplication.objects.filter(internship_id=data[OPENING_ID])
|
||||||
|
else:
|
||||||
|
applications = PlacementApplication.objects.filter(placement_id=data[OPENING_ID])
|
||||||
for i in data[STUDENT_LIST]:
|
for i in data[STUDENT_LIST]:
|
||||||
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:
|
||||||
|
@ -27,14 +34,23 @@ def markStatus(request, id, email, user_type):
|
||||||
raise ValueError("Student already selected")
|
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(
|
if opening_type == "Internship":
|
||||||
company_name=application.placement.company_name,
|
subject = STUDENT_APPLICATION_STATUS_TEMPLATE_SUBJECT.format(
|
||||||
id=application.id)
|
company_name=application.internship.company_name,id=application.id)
|
||||||
data = {
|
data = {
|
||||||
"company_name": application.placement.company_name,
|
"company_name": application.internship.company_name,
|
||||||
"designation": application.placement.designation,
|
"designation": application.internship.designation,
|
||||||
"student_name": application.student.name
|
"student_name": application.student.name
|
||||||
}
|
}
|
||||||
|
else:
|
||||||
|
subject = STUDENT_APPLICATION_STATUS_TEMPLATE_SUBJECT.format(
|
||||||
|
company_name=application.placement.company_name,
|
||||||
|
id=application.id)
|
||||||
|
data = {
|
||||||
|
"company_name": application.placement.company_name,
|
||||||
|
"designation": application.placement.designation,
|
||||||
|
"student_name": application.student.name
|
||||||
|
}
|
||||||
if application.selected: # Sending corresponding email to students
|
if application.selected: # Sending corresponding email to students
|
||||||
sendEmail(email, subject, data, STUDENT_APPLICATION_STATUS_SELECTED_TEMPLATE)
|
sendEmail(email, subject, data, STUDENT_APPLICATION_STATUS_SELECTED_TEMPLATE)
|
||||||
else:
|
else:
|
||||||
|
@ -42,7 +58,7 @@ def markStatus(request, id, email, user_type):
|
||||||
application.chaged_by = get_object_or_404(User, id=id)
|
application.chaged_by = get_object_or_404(User, id=id)
|
||||||
application.save()
|
application.save()
|
||||||
else:
|
else:
|
||||||
raise ValueError("Student - " + i[STUDENT_ID] + " didn't apply for this opening")
|
raise ValueError("Student - " + str(i[STUDENT_ID]) + " didn't apply for this opening")
|
||||||
return Response({'action': "Mark Status", 'message': "Marked Status"},
|
return Response({'action': "Mark Status", 'message': "Marked Status"},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
@ -64,13 +80,22 @@ def getDashboard(request, id, email, user_type):
|
||||||
previous = placements.exclude(deadline_datetime__gt=timezone.now()).filter(
|
previous = placements.exclude(deadline_datetime__gt=timezone.now()).filter(
|
||||||
offer_accepted=True, email_verified=True)
|
offer_accepted=True, email_verified=True)
|
||||||
new = placements.filter(offer_accepted__isnull=True, email_verified=True)
|
new = placements.filter(offer_accepted__isnull=True, email_verified=True)
|
||||||
|
internships=Internship.objects.all().order_by('-created_at')
|
||||||
|
ongoing_internships = internships.filter(deadline_datetime__gt=timezone.now(), offer_accepted=True, email_verified=True)
|
||||||
|
previous_internships = internships.exclude(deadline_datetime__gt=timezone.now()).filter(
|
||||||
|
offer_accepted=True, email_verified=True)
|
||||||
|
new_internships = internships.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
|
||||||
|
ongoing_internships = InternshipSerializerForAdmin(ongoing_internships, many=True).data
|
||||||
|
previous_internships = InternshipSerializerForAdmin(previous_internships, many=True).data
|
||||||
|
new_internships = InternshipSerializerForAdmin(new_internships, many=True).data
|
||||||
|
|
||||||
return Response(
|
return Response(
|
||||||
{'action': "Get Dashboard - Admin", 'message': "Data Found", "ongoing": ongoing, "previous": previous,
|
{'action': "Get Dashboard - Admin", 'message': "Data Found", "ongoing": ongoing, "previous": previous,
|
||||||
"new": new},
|
"new": new, "ongoing_internships": ongoing_internships, "previous_internships": previous_internships,
|
||||||
|
"new_internships": new_internships},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except Http404:
|
except Http404:
|
||||||
return Response({'action': "Get Dashboard - Admin", 'message': 'Student Not Found'},
|
return Response({'action': "Get Dashboard - Admin", 'message': 'Student Not Found'},
|
||||||
|
@ -87,11 +112,21 @@ def getDashboard(request, id, email, user_type):
|
||||||
def updateDeadline(request, id, email, user_type):
|
def updateDeadline(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
|
|
||||||
# Updating deadline date with correct format in datetime field
|
# Updating deadline date with correct format in datetime field
|
||||||
opening.deadline_datetime = datetime.datetime.strptime(data[DEADLINE_DATETIME], '%Y-%m-%d %H:%M:%S %z')
|
opening.deadline_datetime = datetime.datetime.strptime(data[DEADLINE_DATETIME], '%Y-%m-%d %H:%M:%S %z')
|
||||||
opening.changed_by = get_object_or_404(User, id=id)
|
opening.changed_by = get_object_or_404(User, id=id)
|
||||||
opening.save()
|
opening.save()
|
||||||
|
if opening.offer_accepted:
|
||||||
|
send_opening_to_notifications_service(id=opening.id,name=opening.company_name,deadline=data[DEADLINE_DATETIME],role=opening.designation,opening_type=opening_type)
|
||||||
return Response({'action': "Update Deadline", 'message': "Deadline Updated"},
|
return Response({'action': "Update Deadline", 'message': "Deadline Updated"},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except Http404:
|
except Http404:
|
||||||
|
@ -110,13 +145,22 @@ def updateOfferAccepted(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
offer_accepted = data[OFFER_ACCEPTED]
|
offer_accepted = data[OFFER_ACCEPTED]
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
if opening.offer_accepted is None:
|
if opening.offer_accepted is None:
|
||||||
opening.offer_accepted = offer_accepted == "true"
|
opening.offer_accepted = offer_accepted == "true"
|
||||||
opening.changed_by = get_object_or_404(User, id=id)
|
opening.changed_by = get_object_or_404(User, id=id)
|
||||||
opening.save()
|
opening.save()
|
||||||
if opening.offer_accepted:
|
if opening.offer_accepted:
|
||||||
send_opening_notifications(opening.id)
|
deadline_datetime = datetime.datetime.strftime(opening.deadline_datetime, '%Y-%m-%d %H:%M:%S %z')
|
||||||
|
send_opening_to_notifications_service(id=opening.id,name=opening.company_name,deadline=deadline_datetime,role=opening.designation,opening_type=opening_type)
|
||||||
|
send_opening_notifications(opening.id,opening_type)
|
||||||
else:
|
else:
|
||||||
raise ValueError("Offer Status already updated")
|
raise ValueError("Offer Status already updated")
|
||||||
|
|
||||||
|
@ -140,7 +184,14 @@ def updateOfferAccepted(request, id, email, user_type):
|
||||||
def updateEmailVerified(request, id, email, user_type):
|
def updateEmailVerified(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
opening.email_verified = True if data[EMAIL_VERIFIED] == "true" else False
|
opening.email_verified = True if data[EMAIL_VERIFIED] == "true" else False
|
||||||
opening.changed_by = get_object_or_404(User, id=id)
|
opening.changed_by = get_object_or_404(User, id=id)
|
||||||
opening.save()
|
opening.save()
|
||||||
|
@ -161,7 +212,14 @@ def updateEmailVerified(request, id, email, user_type):
|
||||||
def deleteAdditionalInfo(request, id, email, user_type):
|
def deleteAdditionalInfo(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
if data[FIELD] in opening.additional_info:
|
if data[FIELD] in opening.additional_info:
|
||||||
opening.additional_info.remove(data[FIELD])
|
opening.additional_info.remove(data[FIELD])
|
||||||
opening.changed_by = get_object_or_404(User, id=id)
|
opening.changed_by = get_object_or_404(User, id=id)
|
||||||
|
@ -188,7 +246,14 @@ def deleteAdditionalInfo(request, id, email, user_type):
|
||||||
def addAdditionalInfo(request, id, email, user_type):
|
def addAdditionalInfo(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
if data[FIELD] not in opening.additional_info:
|
if data[FIELD] not in opening.additional_info:
|
||||||
opening.additional_info.append(data[FIELD])
|
opening.additional_info.append(data[FIELD])
|
||||||
opening.save()
|
opening.save()
|
||||||
|
@ -215,11 +280,20 @@ def addAdditionalInfo(request, id, email, user_type):
|
||||||
def getApplications(request, id, email, user_type):
|
def getApplications(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.GET
|
data = request.GET
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
if OPENING_TYPE in data:
|
||||||
applications = PlacementApplication.objects.filter(placement=opening)
|
opening_type= data[OPENING_TYPE]
|
||||||
serializer = PlacementApplicationSerializerForAdmin(applications, many=True)
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
|
applications = InternshipApplication.objects.filter(internship=opening)
|
||||||
|
serializer = InternshipApplicationSerializerForAdmin(applications, many=True)
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
|
applications = PlacementApplication.objects.filter(placement=opening)
|
||||||
|
serializer = PlacementApplicationSerializerForAdmin(applications, many=True)
|
||||||
return Response({'action': "Get Applications", 'message': 'Data Found', 'applications': serializer.data},
|
return Response({'action': "Get Applications", 'message': 'Data Found', 'applications': serializer.data},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except Http404:
|
except Http404:
|
||||||
return Response({'action': "Get Applications", 'message': 'Opening Not Found'},
|
return Response({'action': "Get Applications", 'message': 'Opening Not Found'},
|
||||||
status=status.HTTP_404_NOT_FOUND)
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
|
@ -235,13 +309,28 @@ def getApplications(request, id, email, user_type):
|
||||||
def submitApplication(request, id, email, user_type):
|
def submitApplication(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
|
if OPENING_TYPE in data:
|
||||||
|
if data[OPENING_TYPE] == "Internship":
|
||||||
|
opening_type= "Internship"
|
||||||
|
elif data[OPENING_TYPE] == "placements":
|
||||||
|
opening_type= "Placement"
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
|
# print(opening);
|
||||||
student = get_object_or_404(Student, pk=data[STUDENT_ID])
|
student = get_object_or_404(Student, pk=data[STUDENT_ID])
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
# opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
student_user = get_object_or_404(User, id=student.id)
|
student_user = get_object_or_404(User, id=student.id)
|
||||||
if data[APPLICATION_ID] == "":
|
if data[APPLICATION_ID] == "":
|
||||||
application = PlacementApplication()
|
application = PlacementApplication() if opening_type == "Placement" else InternshipApplication()
|
||||||
application.id = generateRandomString()
|
application.id = generateRandomString()
|
||||||
application.placement = opening
|
if(opening_type == "Placement"):
|
||||||
|
application.placement = opening
|
||||||
|
else:
|
||||||
|
application.internship = opening
|
||||||
application.student = student
|
application.student = student
|
||||||
if data[RESUME_FILE_NAME] in student.resumes:
|
if data[RESUME_FILE_NAME] in student.resumes:
|
||||||
application.resume = data[RESUME_FILE_NAME]
|
application.resume = data[RESUME_FILE_NAME]
|
||||||
|
@ -257,7 +346,7 @@ def submitApplication(request, id, email, user_type):
|
||||||
data = {
|
data = {
|
||||||
"name": student.name,
|
"name": student.name,
|
||||||
"company_name": opening.company_name,
|
"company_name": opening.company_name,
|
||||||
"application_type": "Placement",
|
"application_type": "Placement" if opening_type == "Placement" else "Internship",
|
||||||
"additional_info": dict(json.loads(application.additional_info)),
|
"additional_info": dict(json.loads(application.additional_info)),
|
||||||
}
|
}
|
||||||
subject = STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT.format(company_name=opening.company_name)
|
subject = STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT.format(company_name=opening.company_name)
|
||||||
|
@ -267,7 +356,10 @@ def submitApplication(request, id, email, user_type):
|
||||||
return Response({'action': "Add Student Application", 'message': "Application added"},
|
return Response({'action': "Add Student Application", 'message': "Application added"},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
else:
|
else:
|
||||||
application = get_object_or_404(PlacementApplication, id=data[APPLICATION_ID])
|
if opening_type == "Internship":
|
||||||
|
application = get_object_or_404(InternshipApplication, id=data[APPLICATION_ID])
|
||||||
|
else:
|
||||||
|
application = get_object_or_404(PlacementApplication, id=data[APPLICATION_ID])
|
||||||
if application:
|
if application:
|
||||||
if data[RESUME_FILE_NAME] in student.resumes:
|
if data[RESUME_FILE_NAME] in student.resumes:
|
||||||
application.resume = data[RESUME_FILE_NAME]
|
application.resume = data[RESUME_FILE_NAME]
|
||||||
|
@ -285,7 +377,7 @@ def submitApplication(request, id, email, user_type):
|
||||||
data = {
|
data = {
|
||||||
"name": student.name,
|
"name": student.name,
|
||||||
"company_name": opening.company_name,
|
"company_name": opening.company_name,
|
||||||
"application_type": "Placement",
|
"application_type": "Placement" if opening_type == "Placement" else "Internship",
|
||||||
"resume": application.resume[16:],
|
"resume": application.resume[16:],
|
||||||
"additional_info_items": dict(json.loads(application.additional_info)),
|
"additional_info_items": dict(json.loads(application.additional_info)),
|
||||||
}
|
}
|
||||||
|
@ -308,29 +400,39 @@ def submitApplication(request, id, email, user_type):
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError as e:
|
||||||
return Response({'action': "Submit Application", 'message': str(e)},
|
return Response({'action': "Submit Application", 'message': str(e)},
|
||||||
status=status.HTTP_404_NOT_FOUND)
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
|
except AttributeError as e:
|
||||||
|
return Response({'action': "Submit Application", 'message': str(e)},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
except:
|
except:
|
||||||
logger.warning("Submit Application: " + str(sys.exc_info()))
|
logger.warning("Submit Application: " + str(sys.exc_info()))
|
||||||
return Response({'action': "Submit Application", 'message': "Something Went Wrong"},
|
return Response({'action': "Submit Application", 'message': "Something Went Wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
@api_view(['POST'])
|
@api_view(['POST'])
|
||||||
@isAuthorized(allowed_users=[ADMIN])
|
@isAuthorized(allowed_users=[ADMIN])
|
||||||
@precheck(required_data=[OPENING_ID])
|
@precheck(required_data=[OPENING_ID])
|
||||||
def generateCSV(request, id, email, user_type):
|
def generateCSV(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
placement = get_object_or_404(Placement, id=data[OPENING_ID])
|
if OPENING_TYPE in data:
|
||||||
applications = PlacementApplication.objects.filter(placement=placement)
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, id=data[OPENING_ID])
|
||||||
|
applications = InternshipApplication.objects.filter(internship=opening)
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, id=data[OPENING_ID])
|
||||||
|
applications = PlacementApplication.objects.filter(placement=opening)
|
||||||
filename = generateRandomString()
|
filename = generateRandomString()
|
||||||
if not os.path.isdir(STORAGE_DESTINATION_APPLICATION_CSV):
|
if not os.path.isdir(STORAGE_DESTINATION_APPLICATION_CSV):
|
||||||
os.mkdir(STORAGE_DESTINATION_APPLICATION_CSV)
|
os.makedirs(STORAGE_DESTINATION_APPLICATION_CSV, exist_ok=True)
|
||||||
destination_path = STORAGE_DESTINATION_APPLICATION_CSV + filename + ".csv"
|
destination_path = STORAGE_DESTINATION_APPLICATION_CSV + filename + ".csv"
|
||||||
f = open(destination_path, 'w')
|
f = open(destination_path, 'w')
|
||||||
writer = csv.writer(f)
|
writer = csv.writer(f)
|
||||||
header_row = APPLICATION_CSV_COL_NAMES.copy()
|
header_row = APPLICATION_CSV_COL_NAMES.copy()
|
||||||
|
|
||||||
header_row.extend(placement.additional_info)
|
header_row.extend(opening.additional_info)
|
||||||
writer.writerow(header_row)
|
writer.writerow(header_row)
|
||||||
for apl in applications:
|
for apl in applications:
|
||||||
row_details = []
|
row_details = []
|
||||||
|
@ -343,13 +445,12 @@ def generateCSV(request, id, email, user_type):
|
||||||
row_details.append(apl.student.branch)
|
row_details.append(apl.student.branch)
|
||||||
row_details.append(apl.student.batch)
|
row_details.append(apl.student.batch)
|
||||||
row_details.append(apl.student.cpi)
|
row_details.append(apl.student.cpi)
|
||||||
link = LINK_TO_STORAGE_RESUME + urllib.parse.quote(apl.student.id) + "/" + urllib.parse.quote(apl.resume)
|
link = LINK_TO_STORAGE_RESUME + urllib.parse.quote(str(apl.student.id)) + "/" + urllib.parse.quote(str(apl.resume))
|
||||||
row_details.append(link)
|
row_details.append(link)
|
||||||
row_details.append(apl.selected)
|
row_details.append(apl.selected)
|
||||||
|
|
||||||
for i in placement.additional_info:
|
for i in opening.additional_info:
|
||||||
row_details.append(json.loads(apl.additional_info)[i])
|
row_details.append(json.loads(apl.additional_info).get(i, ''))
|
||||||
|
|
||||||
writer.writerow(row_details)
|
writer.writerow(row_details)
|
||||||
f.close()
|
f.close()
|
||||||
file_path = LINK_TO_APPLICATIONS_CSV + urllib.parse.quote_plus(filename + ".csv")
|
file_path = LINK_TO_APPLICATIONS_CSV + urllib.parse.quote_plus(filename + ".csv")
|
||||||
|
@ -361,6 +462,42 @@ def generateCSV(request, id, email, user_type):
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
|
@api_view(['POST'])
|
||||||
|
@isAuthorized(allowed_users=[ADMIN])
|
||||||
|
@precheck(required_data=[OPENING_ID])
|
||||||
|
def downloadResume(request, id, email, user_type):
|
||||||
|
try:
|
||||||
|
data = request.data
|
||||||
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
|
||||||
|
if opening_type == "Internship":
|
||||||
|
opening = get_object_or_404(Internship, id=data[OPENING_ID])
|
||||||
|
applications = InternshipApplication.objects.filter(internship=opening)
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Placement, id=data[OPENING_ID])
|
||||||
|
applications = PlacementApplication.objects.filter(placement=opening)
|
||||||
|
zip_filename = generateRandomString() + ".zip"
|
||||||
|
if not os.path.isdir(STORAGE_DESTINATION_RESUME_ZIP):
|
||||||
|
os.makedirs(STORAGE_DESTINATION_RESUME_ZIP, exist_ok=True)
|
||||||
|
resumes = {}
|
||||||
|
for apl in applications:
|
||||||
|
|
||||||
|
resumes[apl.student.roll_no] = STORAGE_DESTINATION_RESUMES + apl.student.id + '/' + apl.resume # Check if the folder name is student id or user id
|
||||||
|
|
||||||
|
with zipfile.ZipFile(STORAGE_DESTINATION_RESUME_ZIP + zip_filename, 'w', zipfile.ZIP_DEFLATED) as zip_file:
|
||||||
|
for student_roll_no, resume_path in resumes.items():
|
||||||
|
zip_file.write(resume_path, os.path.basename(str(student_roll_no) + ".pdf"))
|
||||||
|
|
||||||
|
file_path = LINK_TO_RESUMES_ZIP + urllib.parse.quote_plus(zip_filename)
|
||||||
|
return Response({'action': "Download resumes", 'message': "Resumes zip created", 'file': file_path},
|
||||||
|
status=status.HTTP_200_OK)
|
||||||
|
except:
|
||||||
|
logger.warning("Create csv: " + str(sys.exc_info()))
|
||||||
|
return Response({'action': "Create csv", 'message': "Something Went Wrong"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
@api_view(['POST'])
|
@api_view(['POST'])
|
||||||
@isAuthorized(allowed_users=[ADMIN])
|
@isAuthorized(allowed_users=[ADMIN])
|
||||||
@precheck(required_data=[COMPANY_NAME, COMPENSATION_GROSS, OFFER_ACCEPTED, STUDENT_ID, DESIGNATION, TIER])
|
@precheck(required_data=[COMPANY_NAME, COMPENSATION_GROSS, OFFER_ACCEPTED, STUDENT_ID, DESIGNATION, TIER])
|
||||||
|
@ -397,6 +534,10 @@ def addPPO(request, id, email, user_type):
|
||||||
def getStudentApplication(request, id, email, user_type):
|
def getStudentApplication(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
student = get_object_or_404(Student, id=data[STUDENT_ID])
|
student = get_object_or_404(Student, id=data[STUDENT_ID])
|
||||||
student_serializer = StudentSerializer(student)
|
student_serializer = StudentSerializer(student)
|
||||||
student_details = {
|
student_details = {
|
||||||
|
@ -406,15 +547,29 @@ def getStudentApplication(request, id, email, user_type):
|
||||||
"resume_list": student_serializer.data['resume_list'],
|
"resume_list": student_serializer.data['resume_list'],
|
||||||
}
|
}
|
||||||
# search for the application if there or not
|
# search for the application if there or not
|
||||||
application = PlacementApplication.objects.filter(student=student,
|
if opening_type == "Internship":
|
||||||
|
application = InternshipApplication.objects.filter(student=student,
|
||||||
|
internship=get_object_or_404(Internship,
|
||||||
|
id=data[OPENING_ID]))
|
||||||
|
else:
|
||||||
|
application = PlacementApplication.objects.filter(student=student,
|
||||||
placement=get_object_or_404(Placement, id=data[OPENING_ID]))
|
placement=get_object_or_404(Placement, id=data[OPENING_ID]))
|
||||||
|
|
||||||
if application:
|
if application:
|
||||||
serializer = PlacementApplicationSerializer(application[0])
|
if opening_type == "Internship":
|
||||||
application_info = {
|
serializer = InternshipApplicationSerializer(application[0])
|
||||||
"id": serializer.data['id'],
|
application_info = {
|
||||||
"additional_info": serializer.data['additional_info'],
|
"id": serializer.data['id'],
|
||||||
"resume": serializer.data['resume_link'],
|
"additional_info": serializer.data['additional_info'],
|
||||||
}
|
"resume": serializer.data['resume_link'],
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
serializer = PlacementApplicationSerializer(application[0])
|
||||||
|
application_info = {
|
||||||
|
"id": serializer.data['id'],
|
||||||
|
"additional_info": serializer.data['additional_info'],
|
||||||
|
"resume": serializer.data['resume_link'],
|
||||||
|
}
|
||||||
return Response(
|
return Response(
|
||||||
{'action': "Get Student Application", 'application_found': "true", "application_info": application_info,
|
{'action': "Get Student Application", 'application_found': "true", "application_info": application_info,
|
||||||
"student_details": student_details}, status=status.HTTP_200_OK)
|
"student_details": student_details}, status=status.HTTP_200_OK)
|
||||||
|
@ -446,6 +601,7 @@ def getStats(request, id, email, user_type):
|
||||||
"5":0,
|
"5":0,
|
||||||
"6":0,
|
"6":0,
|
||||||
"7":0,
|
"7":0,
|
||||||
|
"8":0,
|
||||||
"psu":0,
|
"psu":0,
|
||||||
},
|
},
|
||||||
"EE": {
|
"EE": {
|
||||||
|
@ -466,9 +622,21 @@ def getStats(request, id, email, user_type):
|
||||||
"5":0,
|
"5":0,
|
||||||
"6":0,
|
"6":0,
|
||||||
"7":0,
|
"7":0,
|
||||||
|
"8":0,
|
||||||
"psu":0,
|
"psu":0,
|
||||||
|
|
||||||
},
|
},
|
||||||
|
"EP":{
|
||||||
|
"1":0,
|
||||||
|
"2":0,
|
||||||
|
"3":0,
|
||||||
|
"4":0,
|
||||||
|
"5":0,
|
||||||
|
"6":0,
|
||||||
|
"7":0,
|
||||||
|
"8":0,
|
||||||
|
"psu":0,
|
||||||
|
},
|
||||||
"Total": {
|
"Total": {
|
||||||
"1":0,
|
"1":0,
|
||||||
"2":0,
|
"2":0,
|
||||||
|
@ -477,6 +645,7 @@ def getStats(request, id, email, user_type):
|
||||||
"5":0,
|
"5":0,
|
||||||
"6":0,
|
"6":0,
|
||||||
"7":0,
|
"7":0,
|
||||||
|
"8":0,
|
||||||
"psu":0,
|
"psu":0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -484,6 +653,7 @@ def getStats(request, id, email, user_type):
|
||||||
"CSE": 0,
|
"CSE": 0,
|
||||||
"EE": 0,
|
"EE": 0,
|
||||||
"MMAE": 0,
|
"MMAE": 0,
|
||||||
|
"EP": 0,
|
||||||
"Total": 0,
|
"Total": 0,
|
||||||
}
|
}
|
||||||
number_of_students_with_multiple_offers = 0
|
number_of_students_with_multiple_offers = 0
|
||||||
|
@ -491,22 +661,26 @@ def getStats(request, id, email, user_type):
|
||||||
"CSE": 0,
|
"CSE": 0,
|
||||||
"EE": 0,
|
"EE": 0,
|
||||||
"MMAE": 0,
|
"MMAE": 0,
|
||||||
|
"EP": 0,
|
||||||
"Total": 0,
|
"Total": 0,
|
||||||
}
|
}
|
||||||
max_CTC = {
|
max_CTC = {
|
||||||
"CSE": 0,
|
"CSE": 0,
|
||||||
"EE": 0,
|
"EE": 0,
|
||||||
"MMAE": 0
|
"MMAE": 0,
|
||||||
|
"EP": 0,
|
||||||
}
|
}
|
||||||
average_CTC = {
|
average_CTC = {
|
||||||
"CSE": 0,
|
"CSE": 0,
|
||||||
"EE": 0,
|
"EE": 0,
|
||||||
"MMAE": 0
|
"MMAE": 0,
|
||||||
|
"EP": 0,
|
||||||
}
|
}
|
||||||
count = {
|
count = {
|
||||||
"CSE": 0,
|
"CSE": 0,
|
||||||
"EE": 0,
|
"EE": 0,
|
||||||
"MMAE": 0
|
"MMAE": 0,
|
||||||
|
"EP": 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -628,6 +802,34 @@ def getStats(request, id, email, user_type):
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except:
|
except:
|
||||||
logger.warning("Get Stats: " + str(sys.exc_info()))
|
logger.warning("Get Stats: " + str(sys.exc_info()))
|
||||||
print(sys.exc_info())
|
|
||||||
return Response({'action': "Get Stats", 'message': "Something Went Wrong"},
|
return Response({'action': "Get Stats", 'message': "Something Went Wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
|
@api_view(['GET'])
|
||||||
|
@isAuthorizedService()
|
||||||
|
@precheck(required_data=[OPENING_ID])
|
||||||
|
def get_eligible_students(request):
|
||||||
|
try:
|
||||||
|
data = request.GET
|
||||||
|
opening_id = data[OPENING_ID]
|
||||||
|
if OPENING_TYPE in data:
|
||||||
|
opening_type= data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type= "Placement"
|
||||||
|
if "send_all" in data:
|
||||||
|
send_all = "True"==data["send_all"]
|
||||||
|
else:
|
||||||
|
send_all = False
|
||||||
|
eligible_students=get_eligible_emails(opening_id=opening_id, opening_type=opening_type, send_all=send_all)
|
||||||
|
return Response({'action': "Get Eligible Students", 'message': "Eligible Students Fetched",
|
||||||
|
'eligible_students': eligible_students},
|
||||||
|
status=status.HTTP_200_OK)
|
||||||
|
except Http404:
|
||||||
|
return Response({'action': "Get Eligible Students", 'message': "Opening Not Found"},
|
||||||
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
|
except:
|
||||||
|
logger.warning("Get Eligible Students: " + str(sys.exc_info()))
|
||||||
|
return Response({'action': "Get Eligible Students", 'message': "Something Went Wrong"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
|
@ -7,4 +7,5 @@ urlpatterns = [
|
||||||
path('verifyEmail/', companyViews.verifyEmail, name="Verify Email"),
|
path('verifyEmail/', companyViews.verifyEmail, name="Verify Email"),
|
||||||
path('getAutoFillJnf/', companyViews.autoFillJnf, name="Auto FIll JNF"),
|
path('getAutoFillJnf/', companyViews.autoFillJnf, name="Auto FIll JNF"),
|
||||||
path('addInternship/',companyViews.addInternship,name="Add Internship"),
|
path('addInternship/',companyViews.addInternship,name="Add Internship"),
|
||||||
|
path('getAutoFillInf/', companyViews.autoFillInf, name="Auto FIll INF"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,12 +11,14 @@ logger = logging.getLogger('db')
|
||||||
IS_COMPANY_DETAILS_PDF, CONTACT_PERSON_NAME, PHONE_NUMBER, EMAIL, CITY, STATE, COUNTRY, PINCODE, DESIGNATION,
|
IS_COMPANY_DETAILS_PDF, CONTACT_PERSON_NAME, PHONE_NUMBER, EMAIL, CITY, STATE, COUNTRY, PINCODE, DESIGNATION,
|
||||||
DESCRIPTION,
|
DESCRIPTION,
|
||||||
IS_DESCRIPTION_PDF, COMPENSATION_CTC, COMPENSATION_GROSS, COMPENSATION_TAKE_HOME, COMPENSATION_BONUS,
|
IS_DESCRIPTION_PDF, COMPENSATION_CTC, COMPENSATION_GROSS, COMPENSATION_TAKE_HOME, COMPENSATION_BONUS,
|
||||||
IS_COMPENSATION_DETAILS_PDF, ALLOWED_BRANCH, RS_ELIGIBLE, SELECTION_PROCEDURE_ROUNDS,
|
IS_COMPENSATION_DETAILS_PDF, ALLOWED_BRANCH, ELIGIBLESTUDENTS, SELECTION_PROCEDURE_ROUNDS,
|
||||||
SELECTION_PROCEDURE_DETAILS,
|
SELECTION_PROCEDURE_DETAILS,
|
||||||
IS_SELECTION_PROCEDURE_DETAILS_PDF, TENTATIVE_DATE_OF_JOINING, TENTATIVE_NO_OF_OFFERS, OTHER_REQUIREMENTS,
|
IS_SELECTION_PROCEDURE_DETAILS_PDF, TENTATIVE_DATE_OF_JOINING, TENTATIVE_NO_OF_OFFERS, OTHER_REQUIREMENTS,
|
||||||
RECAPTCHA_VALUE, JOB_LOCATION
|
RECAPTCHA_VALUE, JOB_LOCATION,PSYCHOMETRIC_TEST,MEDICAL_TEST,NUMBER_OF_EMPLOYEES,BACKLOG_ELIGIBLE,PWD_ELIGIBLE,CPI,EXPECTED_NO_OF_OFFERS])
|
||||||
])
|
|
||||||
def addPlacement(request):
|
def addPlacement(request):
|
||||||
|
logger.info("JNF filled by " + str(request.data['email']))
|
||||||
|
logger.info(request.data)
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
files = request.FILES
|
files = request.FILES
|
||||||
|
@ -34,11 +36,35 @@ def addPlacement(request):
|
||||||
opening.website = data[WEBSITE]
|
opening.website = data[WEBSITE]
|
||||||
opening.company_details = data[COMPANY_DETAILS]
|
opening.company_details = data[COMPANY_DETAILS]
|
||||||
opening.is_company_details_pdf = data[IS_COMPANY_DETAILS_PDF]
|
opening.is_company_details_pdf = data[IS_COMPANY_DETAILS_PDF]
|
||||||
if data[RS_ELIGIBLE] == 'Yes':
|
# if data[RS_ELIGIBLE] == 'Yes':
|
||||||
opening.rs_eligible = True
|
# opening.rs_eligible = True
|
||||||
|
# else:
|
||||||
|
# opening.rs_eligible = False
|
||||||
|
|
||||||
|
if data[ELIGIBLESTUDENTS] is None:
|
||||||
|
raise ValueError('Eligible Students cannot be empty')
|
||||||
|
elif set(json.loads(data[ELIGIBLESTUDENTS])).issubset(ELIGIBLE):
|
||||||
|
opening.eligiblestudents = json.loads(data[ELIGIBLESTUDENTS])
|
||||||
else:
|
else:
|
||||||
opening.rs_eligible = False
|
raise ValueError('Allowed Branch must be a subset of ' + str(ELIGIBLE))
|
||||||
|
if data[PWD_ELIGIBLE] == 'Yes':
|
||||||
|
opening.pwd_eligible = True
|
||||||
|
else:
|
||||||
|
opening.pwd_eligible = False
|
||||||
|
if data[BACKLOG_ELIGIBLE] == 'Yes':
|
||||||
|
opening.backlog_eligible = True
|
||||||
|
else:
|
||||||
|
opening.backlog_eligible = False
|
||||||
|
if data[PSYCHOMETRIC_TEST] == 'Yes':
|
||||||
|
opening.psychometric_test = True
|
||||||
|
else:
|
||||||
|
opening.psychometric_test = False
|
||||||
|
if data[MEDICAL_TEST] == 'Yes':
|
||||||
|
opening.medical_test = True
|
||||||
|
else:
|
||||||
|
opening.medical_test = False
|
||||||
|
|
||||||
|
opening.cpi_eligible = data[CPI]
|
||||||
if opening.is_company_details_pdf:
|
if opening.is_company_details_pdf:
|
||||||
company_details_pdf = []
|
company_details_pdf = []
|
||||||
for file in files.getlist(COMPANY_DETAILS_PDF):
|
for file in files.getlist(COMPANY_DETAILS_PDF):
|
||||||
|
@ -57,11 +83,9 @@ def addPlacement(request):
|
||||||
# Add a contact person details in the opening
|
# Add a contact person details in the opening
|
||||||
opening.contact_person_name = data[CONTACT_PERSON_NAME]
|
opening.contact_person_name = data[CONTACT_PERSON_NAME]
|
||||||
# Check if Phone number is Integer
|
# Check if Phone number is Integer
|
||||||
if data[PHONE_NUMBER].isdigit():
|
|
||||||
opening.phone_number = int(data[PHONE_NUMBER])
|
opening.phone_number = data[PHONE_NUMBER]
|
||||||
else:
|
|
||||||
raise ValueError('Phone number should be integer')
|
|
||||||
|
|
||||||
opening.email = data[EMAIL]
|
opening.email = data[EMAIL]
|
||||||
|
|
||||||
# Add a company location in the opening
|
# Add a company location in the opening
|
||||||
|
@ -111,6 +135,18 @@ def addPlacement(request):
|
||||||
opening.compensation_CTC = None
|
opening.compensation_CTC = None
|
||||||
else:
|
else:
|
||||||
raise ValueError('Compensation CTC must be an integer')
|
raise ValueError('Compensation CTC must be an integer')
|
||||||
|
# Newly added
|
||||||
|
|
||||||
|
if data[COMPANY_TURNOVER].isdigit():
|
||||||
|
opening.company_turnover = int(data[COMPANY_TURNOVER])
|
||||||
|
elif data[COMPANY_TURNOVER] is None or data[COMPANY_TURNOVER] == '':
|
||||||
|
opening.company_turnover = None
|
||||||
|
else:
|
||||||
|
# Handle the case where the data is not a valid number or None/empty
|
||||||
|
# You can raise an error, set a default value, or log a warning
|
||||||
|
opening.company_turnover = None # Or some default value or error handling
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if compensation_gross is integer
|
# Check if compensation_gross is integer
|
||||||
if data[COMPENSATION_GROSS].isdigit():
|
if data[COMPENSATION_GROSS].isdigit():
|
||||||
|
@ -193,6 +229,14 @@ def addPlacement(request):
|
||||||
# Convert to date object
|
# Convert to date object
|
||||||
opening.tentative_date_of_joining = datetime.datetime.strptime(data[TENTATIVE_DATE_OF_JOINING],
|
opening.tentative_date_of_joining = datetime.datetime.strptime(data[TENTATIVE_DATE_OF_JOINING],
|
||||||
'%d-%m-%Y').date()
|
'%d-%m-%Y').date()
|
||||||
|
establishment_date_str = data.get('ESTABLISHMENT_DATE', '')
|
||||||
|
if establishment_date_str:
|
||||||
|
try:
|
||||||
|
opening.establishment_date = datetime.datetime.strptime(establishment_date_str, '%d-%m-%Y').date()
|
||||||
|
except ValueError:
|
||||||
|
opening.establishment_date = None
|
||||||
|
else:
|
||||||
|
opening.establishment_date = None
|
||||||
|
|
||||||
# Only Allowing Fourth Year for Placement
|
# Only Allowing Fourth Year for Placement
|
||||||
opening.allowed_batch = [FOURTH_YEAR,]
|
opening.allowed_batch = [FOURTH_YEAR,]
|
||||||
|
@ -211,8 +255,17 @@ def addPlacement(request):
|
||||||
opening.tentative_no_of_offers = None
|
opening.tentative_no_of_offers = None
|
||||||
else:
|
else:
|
||||||
raise ValueError('Tentative No Of Offers must be an integer')
|
raise ValueError('Tentative No Of Offers must be an integer')
|
||||||
|
# newly added
|
||||||
|
if data[EXPECTED_NO_OF_OFFERS].isdigit():
|
||||||
|
opening.expected_no_of_offers = int(data[EXPECTED_NO_OF_OFFERS])
|
||||||
|
elif data[EXPECTED_NO_OF_OFFERS] == 'null':
|
||||||
|
opening.expected_no_of_offers = None
|
||||||
opening.other_requirements = data[OTHER_REQUIREMENTS]
|
opening.other_requirements = data[OTHER_REQUIREMENTS]
|
||||||
|
# newly added
|
||||||
|
if data[NUMBER_OF_EMPLOYEES].isdigit():
|
||||||
|
opening.number_of_employees = int(data[NUMBER_OF_EMPLOYEES])
|
||||||
|
elif data[NUMBER_OF_EMPLOYEES] == 'null':
|
||||||
|
opening.number_of_employees = None
|
||||||
|
|
||||||
opening.save()
|
opening.save()
|
||||||
|
|
||||||
|
@ -233,20 +286,19 @@ def addPlacement(request):
|
||||||
|
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
store_all_files(request)
|
store_all_files(request)
|
||||||
exception_email(data)
|
|
||||||
logger.warning("ValueError in addPlacement: " + str(e))
|
logger.warning("ValueError in addPlacement: " + str(e))
|
||||||
logger.warning(traceback.format_exc())
|
logger.warning(traceback.format_exc())
|
||||||
return Response({'action': "Add Placement", 'message': str(e)},
|
return Response({'action': "Add Placement", 'message': str(e)},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
except:
|
except Exception as e:
|
||||||
store_all_files(request)
|
store_all_files(request)
|
||||||
exception_email(data)
|
logger.warning("Add New Placement: " + str(e))
|
||||||
logger.warning("Add New Placement: " + str(sys.exc_info()))
|
|
||||||
logger.warning(traceback.format_exc())
|
logger.warning(traceback.format_exc())
|
||||||
return Response({'action': "Add Placement", 'message': "Something went wrong"},
|
return Response({'action': "Add Placement", 'message': "Something went wrong: " + str(e)},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@api_view(['POST'])
|
@api_view(['POST'])
|
||||||
@precheck([TOKEN])
|
@precheck([TOKEN])
|
||||||
def verifyEmail(request):
|
def verifyEmail(request):
|
||||||
|
@ -321,6 +373,24 @@ def autoFillJnf(request):
|
||||||
return Response({'action': "Get AutoFill", 'message': "Something went wrong"},
|
return Response({'action': "Get AutoFill", 'message': "Something went wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
@api_view(['GET'])
|
||||||
|
@precheck([INTERNSHIP_ID])
|
||||||
|
def autoFillInf(request):
|
||||||
|
try:
|
||||||
|
data = request.GET
|
||||||
|
internship_id = data.get(INTERNSHIP_ID)
|
||||||
|
opening = get_object_or_404(Internship, id=internship_id)
|
||||||
|
serializer = AutofillSerializersInternship(opening)
|
||||||
|
return Response({'action': "Get AutoFill ", 'message': 'Data Found', 'internship_data': serializer.data},
|
||||||
|
status=status.HTTP_200_OK)
|
||||||
|
except Http404:
|
||||||
|
return Response({'action': "Get AutoFill", 'message': 'Internship Not Found'},
|
||||||
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
|
except Exception as e:
|
||||||
|
traceback_str = traceback.format_exc()
|
||||||
|
logger.warning("Get AutoFill: " + traceback_str)
|
||||||
|
return Response({'action': "Get AutoFill", 'message': "Something went wrong"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
## Internships ##
|
## Internships ##
|
||||||
|
|
||||||
|
@ -329,12 +399,13 @@ def autoFillJnf(request):
|
||||||
@precheck([COMPANY_NAME, WEBSITE, IS_COMPANY_DETAILS_PDF, COMPANY_DETAILS, ADDRESS,
|
@precheck([COMPANY_NAME, WEBSITE, IS_COMPANY_DETAILS_PDF, COMPANY_DETAILS, ADDRESS,
|
||||||
CITY, STATE, COUNTRY, PINCODE, COMPANY_TYPE, NATURE_OF_BUSINESS, IS_DESCRIPTION_PDF,
|
CITY, STATE, COUNTRY, PINCODE, COMPANY_TYPE, NATURE_OF_BUSINESS, IS_DESCRIPTION_PDF,
|
||||||
DESIGNATION, INTERNSHIP_LOCATION, DESCRIPTION, SEASON, START_DATE, END_DATE, WORK_TYPE,
|
DESIGNATION, INTERNSHIP_LOCATION, DESCRIPTION, SEASON, START_DATE, END_DATE, WORK_TYPE,
|
||||||
ALLOWED_BRANCH, SOPHOMORES_ELIIGIBLE, RS_ELIGIBLE, NUM_OFFERS, IS_STIPEND_DETAILS_PDF, STIPEND,
|
ALLOWED_BRANCH, ELIGIBLESTUDENTS, NUM_OFFERS, IS_STIPEND_DETAILS_PDF, STIPEND,
|
||||||
FACILITIES, OTHER_FACILITIES, SELECTION_PROCEDURE_ROUNDS, SELECTION_PROCEDURE_DETAILS, IS_SELECTION_PROCEDURE_DETAILS_PDF,
|
FACILITIES, OTHER_FACILITIES, SELECTION_PROCEDURE_ROUNDS, SELECTION_PROCEDURE_DETAILS, IS_SELECTION_PROCEDURE_DETAILS_PDF,
|
||||||
SELECTION_PROCEDURE_DETAILS, OTHER_REQUIREMENTS,
|
SELECTION_PROCEDURE_DETAILS, OTHER_REQUIREMENTS,
|
||||||
CONTACT_PERSON_NAME, PHONE_NUMBER, EMAIL, RECAPTCHA_VALUE])
|
CONTACT_PERSON_NAME, PHONE_NUMBER, EMAIL, RECAPTCHA_VALUE ,ESTABLISHMENT_DATE,PWD_ELIGIBLE,BACKLOG_ELIGIBLE,PSYCHOMETRIC_TEST,MEDICAL_TEST,CPI,EXPECTED_NO_OF_OFFERS,NUMBER_OF_EMPLOYEES,COMPANY_TURNOVER])
|
||||||
def addInternship(request):
|
def addInternship(request):
|
||||||
logger.info("INF filled by " + str(request.data['email']))
|
logger.info("INF filled by " + str(request.data['email']))
|
||||||
|
logger.info(request.data)
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
files = request.FILES
|
files = request.FILES
|
||||||
|
@ -392,11 +463,26 @@ def addInternship(request):
|
||||||
raise ValueError('Season must be a subset of ' + str(SEASONS))
|
raise ValueError('Season must be a subset of ' + str(SEASONS))
|
||||||
internship.interning_period_from = datetime.datetime.strptime(data[START_DATE], '%d-%m-%Y').date()
|
internship.interning_period_from = datetime.datetime.strptime(data[START_DATE], '%d-%m-%Y').date()
|
||||||
internship.interning_period_to = datetime.datetime.strptime(data[END_DATE], '%d-%m-%Y').date()
|
internship.interning_period_to = datetime.datetime.strptime(data[END_DATE], '%d-%m-%Y').date()
|
||||||
|
establishment_date_str = data.get('ESTABLISHMENT_DATE', '')
|
||||||
|
if establishment_date_str:
|
||||||
|
try:
|
||||||
|
internship.establishment_date = datetime.datetime.strptime(establishment_date_str, '%d-%m-%Y').date()
|
||||||
|
except ValueError:
|
||||||
|
internship.establishment_date = None
|
||||||
|
else:
|
||||||
|
internship.establishment_date = None
|
||||||
if data[WORK_TYPE] == 'Work from home':
|
if data[WORK_TYPE] == 'Work from home':
|
||||||
internship.is_work_from_home = True
|
internship.is_work_from_home = True
|
||||||
else:
|
else:
|
||||||
internship.is_work_from_home = False
|
internship.is_work_from_home = False
|
||||||
|
if ALLOWED_BATCH in data and (data[ALLOWED_BATCH] is None or json.loads(data[ALLOWED_BATCH]) == ""):
|
||||||
|
raise ValueError('Allowed Batches cannot be empty')
|
||||||
|
elif ALLOWED_BATCH in data and set(json.loads(data[ALLOWED_BATCH])).issubset(BATCHES):
|
||||||
|
internship.allowed_batch = json.loads(data[ALLOWED_BATCH])
|
||||||
|
else:
|
||||||
|
internship.allowed_batch = ['2021']
|
||||||
|
|
||||||
|
|
||||||
if data[ALLOWED_BRANCH] is None or json.loads(data[ALLOWED_BRANCH]) == "":
|
if data[ALLOWED_BRANCH] is None or json.loads(data[ALLOWED_BRANCH]) == "":
|
||||||
raise ValueError('Allowed Branch cannot be empty')
|
raise ValueError('Allowed Branch cannot be empty')
|
||||||
elif set(json.loads(data[ALLOWED_BRANCH])).issubset(BRANCHES):
|
elif set(json.loads(data[ALLOWED_BRANCH])).issubset(BRANCHES):
|
||||||
|
@ -404,14 +490,35 @@ def addInternship(request):
|
||||||
else:
|
else:
|
||||||
raise ValueError('Allowed Branch must be a subset of ' + str(BRANCHES))
|
raise ValueError('Allowed Branch must be a subset of ' + str(BRANCHES))
|
||||||
|
|
||||||
if data[SOPHOMORES_ELIIGIBLE] == 'Yes':
|
# if data[SOPHOMORES_ELIIGIBLE] == 'Yes':
|
||||||
internship.sophomore_eligible = True
|
# internship.sophomore_eligible = True
|
||||||
|
# else:
|
||||||
|
# internship.sophomore_eligible = False
|
||||||
|
if data[ELIGIBLESTUDENTS] is None:
|
||||||
|
raise ValueError('Eligible Students cannot be empty')
|
||||||
|
elif set(json.loads(data[ELIGIBLESTUDENTS])).issubset(ELIGIBLE):
|
||||||
|
internship.eligiblestudents = json.loads(data[ELIGIBLESTUDENTS])
|
||||||
else:
|
else:
|
||||||
internship.sophomore_eligible = False
|
raise ValueError('Allowed Branch must be a subset of ' + str(ELIGIBLE))
|
||||||
if data[RS_ELIGIBLE] == 'Yes':
|
|
||||||
internship.rs_eligible = True
|
if data[PWD_ELIGIBLE] == 'Yes':
|
||||||
|
internship.pwd_eligible = True
|
||||||
else:
|
else:
|
||||||
internship.rs_eligible = False
|
internship.pwd_eligible = False
|
||||||
|
if data[BACKLOG_ELIGIBLE] == 'Yes':
|
||||||
|
internship.backlog_eligible = True
|
||||||
|
else:
|
||||||
|
internship.backlog_eligible = False
|
||||||
|
if data[PSYCHOMETRIC_TEST] == 'Yes':
|
||||||
|
internship.psychometric_test = True
|
||||||
|
else:
|
||||||
|
internship.psychometric_test = False
|
||||||
|
if data[MEDICAL_TEST] == 'Yes':
|
||||||
|
internship.medical_test = True
|
||||||
|
else:
|
||||||
|
internship.medical_test = False
|
||||||
|
|
||||||
|
internship.cpi_eligible = data[CPI]
|
||||||
if data[NUM_OFFERS].isdigit():
|
if data[NUM_OFFERS].isdigit():
|
||||||
internship.tentative_no_of_offers = int(data[NUM_OFFERS])
|
internship.tentative_no_of_offers = int(data[NUM_OFFERS])
|
||||||
else:
|
else:
|
||||||
|
@ -433,6 +540,26 @@ def addInternship(request):
|
||||||
internship.stipend = int(data[STIPEND])
|
internship.stipend = int(data[STIPEND])
|
||||||
else:
|
else:
|
||||||
raise ValueError('Stipend must be an integer')
|
raise ValueError('Stipend must be an integer')
|
||||||
|
# Newly added
|
||||||
|
if data[COMPANY_TURNOVER].isdigit():
|
||||||
|
internship.company_turnover = int(data[COMPANY_TURNOVER])
|
||||||
|
elif data[COMPANY_TURNOVER] is None or data[COMPANY_TURNOVER] == '':
|
||||||
|
internship.company_turnover = None
|
||||||
|
else:
|
||||||
|
# Handle the case where the data is not a valid number or None/empty
|
||||||
|
# You can raise an error, set a default value, or log a warning
|
||||||
|
internship.company_turnover = None # Or some default value or error handling
|
||||||
|
# newly added
|
||||||
|
if data[EXPECTED_NO_OF_OFFERS].isdigit():
|
||||||
|
internship.expected_no_of_offers = int(data[EXPECTED_NO_OF_OFFERS])
|
||||||
|
elif data[EXPECTED_NO_OF_OFFERS] == 'null':
|
||||||
|
internship.expected_no_of_offers = None
|
||||||
|
internship.other_requirements = data[OTHER_REQUIREMENTS]
|
||||||
|
# newly added
|
||||||
|
if data[NUMBER_OF_EMPLOYEES].isdigit():
|
||||||
|
internship.number_of_employees = int(data[NUMBER_OF_EMPLOYEES])
|
||||||
|
elif data[NUMBER_OF_EMPLOYEES] == 'null':
|
||||||
|
internship.number_of_employees = None
|
||||||
if data[FACILITIES] != "" :
|
if data[FACILITIES] != "" :
|
||||||
if json.loads(data[FACILITIES]) == "":
|
if json.loads(data[FACILITIES]) == "":
|
||||||
internship.facilities_provided = []
|
internship.facilities_provided = []
|
||||||
|
@ -468,6 +595,11 @@ def addInternship(request):
|
||||||
internship.selection_procedure_details_pdf_names = selection_procedure_details_pdf
|
internship.selection_procedure_details_pdf_names = selection_procedure_details_pdf
|
||||||
|
|
||||||
internship.additional_facilities = data[OTHER_FACILITIES]
|
internship.additional_facilities = data[OTHER_FACILITIES]
|
||||||
|
#add additional info
|
||||||
|
# Only Allowing Fourth Year for Placement
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
internship.academic_requirements = data[OTHER_REQUIREMENTS]
|
internship.academic_requirements = data[OTHER_REQUIREMENTS]
|
||||||
|
|
||||||
|
|
||||||
|
@ -492,15 +624,15 @@ def addInternship(request):
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
store_all_files(request)
|
store_all_files(request)
|
||||||
# exception_email(data)
|
|
||||||
logger.warning("ValueError in addInternship: " + str(e))
|
logger.warning("ValueError in addInternship: " + str(e))
|
||||||
logger.warning(traceback.format_exc())
|
logger.warning(traceback.format_exc())
|
||||||
return Response({'action': "Add Internship", 'message': str(e)},
|
return Response({'action': "Add Internship", 'message': str(e)},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
except:
|
except Exception as e:
|
||||||
store_all_files(request)
|
store_all_files(request)
|
||||||
# exception_email(data)
|
logger.warning("Add New Internship: " + str(e))
|
||||||
logger.warning("Add New Internship: " + str(sys.exc_info()))
|
|
||||||
logger.warning(traceback.format_exc())
|
logger.warning(traceback.format_exc())
|
||||||
return Response({'action': "Add Internship", 'message': "Something went wrong"},
|
return Response({'action': "Add Internship", 'message': "Something went wrong: " + str(e)},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,42 @@ BRANCH_CHOICES = [
|
||||||
["ME", "ME"],
|
["ME", "ME"],
|
||||||
['MMAE', 'MMAE'],
|
['MMAE', 'MMAE'],
|
||||||
['EP', 'EP'],
|
['EP', 'EP'],
|
||||||
|
['CIVIL', 'CIVIL'],
|
||||||
|
['CHEMICAL', 'CHEMICAL'],
|
||||||
|
['MNC','MNC']
|
||||||
|
]
|
||||||
|
ELIGIBLE_CHOICES = [
|
||||||
|
["Btech", "Btech"],
|
||||||
|
["MS", "MS"],
|
||||||
|
["MTech", "MTech"],
|
||||||
|
["PHD", "PHD"],
|
||||||
|
["BSMS", "BSMS"],
|
||||||
]
|
]
|
||||||
BRANCHES = [
|
BRANCHES = [
|
||||||
"CSE",
|
"CSE",
|
||||||
"EE",
|
"EE",
|
||||||
"MMAE",
|
"MMAE",
|
||||||
"EP"
|
"EP",
|
||||||
|
"CIVIL",
|
||||||
|
"CHEMICAL",
|
||||||
|
"MNC",
|
||||||
|
]
|
||||||
|
ELIGIBLE =[
|
||||||
|
"Btech",
|
||||||
|
"MS",
|
||||||
|
"MTech",
|
||||||
|
"PHD",
|
||||||
|
"BSMS",
|
||||||
|
]
|
||||||
|
BATCHES = [ #change it accordingly
|
||||||
|
"2023",
|
||||||
|
"2022",
|
||||||
|
"2021",
|
||||||
|
"2020",
|
||||||
]
|
]
|
||||||
BATCH_CHOICES = [
|
BATCH_CHOICES = [
|
||||||
|
["2023","2023"],
|
||||||
|
["2022", "2022"],
|
||||||
["2021", "2021"],
|
["2021", "2021"],
|
||||||
["2020", "2020"],
|
["2020", "2020"],
|
||||||
["2019", "2019"],
|
["2019", "2019"],
|
||||||
|
@ -37,23 +65,35 @@ TIERS = [
|
||||||
['5', 'Tier 5'],
|
['5', 'Tier 5'],
|
||||||
['6', 'Tier 6'],
|
['6', 'Tier 6'],
|
||||||
['7', 'Tier 7'],
|
['7', 'Tier 7'],
|
||||||
|
['8', 'Open Tier'],
|
||||||
]
|
]
|
||||||
|
bTech = 'Btech'
|
||||||
|
# not being used anywhere
|
||||||
DEGREE_CHOICES = [
|
DEGREE_CHOICES = [
|
||||||
['bTech', 'B.Tech'],
|
['bTech', 'B.Tech'],
|
||||||
['ms/phd', 'MS/ PhD'],
|
['ms/phd', 'MS/ PhD'],
|
||||||
|
['mTech', 'M.Tech'],
|
||||||
]
|
]
|
||||||
|
|
||||||
TOTAL_BRANCHES = 4 # Total No of Branches
|
TOTAL_BRANCHES = 7 # Total No of Branches
|
||||||
TOTAL_BATCHES = 5 # Total No of Batches
|
TOTAL_BATCHES = 6 # Total No of Batches
|
||||||
|
|
||||||
CDC_REPS_EMAILS = [
|
CDC_REPS_EMAILS = [
|
||||||
"cdc@iitdh.ac.in",
|
"cdc@iitdh.ac.in",
|
||||||
"cdcfic@iitdh.ac.in",
|
"cdcfic@iitdh.ac.in",
|
||||||
"priyanka.naga@iitdh.ac.in",
|
"vandana@iitdh.ac.in",
|
||||||
"bharathbn@iitdh.ac.in",
|
"sairam@iitdh.ac.in",
|
||||||
"naveenmb@iitdh.ac.in",
|
"satyapriya.gupta@iitdh.ac.in",
|
||||||
"sraut@iitdh.ac.in"
|
"dhriti.ghosh@iitdh.ac.in",
|
||||||
|
"suvamay.jana@iitdh.ac.in",
|
||||||
|
"ramesh.nayaka@iitdh.ac.in",
|
||||||
|
"210010003@iitdh.ac.in",
|
||||||
|
"210010046@iitdh.ac.in",
|
||||||
|
"210030035@iitdh.ac.in",
|
||||||
|
]
|
||||||
|
CDC_REPS_EMAILS_FOR_ISSUE=[ #add reps emails
|
||||||
|
"cdc.support@iitdh.ac.in",
|
||||||
|
"cdc@iitdh.ac.in"
|
||||||
]
|
]
|
||||||
|
|
||||||
# To be Configured Properly
|
# To be Configured Properly
|
||||||
|
@ -67,6 +107,7 @@ PLACEMENT_OPENING_URL = "https://cdc.iitdh.ac.in/portal/student/dashboard/placem
|
||||||
LINK_TO_STORAGE_COMPANY_ATTACHMENT = "https://cdc.iitdh.ac.in/storage/Company_Attachments/"
|
LINK_TO_STORAGE_COMPANY_ATTACHMENT = "https://cdc.iitdh.ac.in/storage/Company_Attachments/"
|
||||||
LINK_TO_STORAGE_RESUME = "https://cdc.iitdh.ac.in/storage/Resumes/"
|
LINK_TO_STORAGE_RESUME = "https://cdc.iitdh.ac.in/storage/Resumes/"
|
||||||
LINK_TO_APPLICATIONS_CSV = "https://cdc.iitdh.ac.in/storage/Application_CSV/"
|
LINK_TO_APPLICATIONS_CSV = "https://cdc.iitdh.ac.in/storage/Application_CSV/"
|
||||||
|
LINK_TO_RESUMES_ZIP = "https://cdc.iitdh.ac.in/storage/Resume_Zips/"
|
||||||
LINK_TO_EMAIl_VERIFICATION_API = "https://cdc.iitdh.ac.in/portal/company/verifyEmail?token={token}"
|
LINK_TO_EMAIl_VERIFICATION_API = "https://cdc.iitdh.ac.in/portal/company/verifyEmail?token={token}"
|
||||||
PDF_FILES_SERVING_ENDPOINT = 'https://cdc.iitdh.ac.in/storage/Company_Attachments/' # TODO: Change this to actual URL
|
PDF_FILES_SERVING_ENDPOINT = 'https://cdc.iitdh.ac.in/storage/Company_Attachments/' # TODO: Change this to actual URL
|
||||||
|
|
||||||
|
@ -78,10 +119,11 @@ EMAIL = "email"
|
||||||
STUDENT = 'student'
|
STUDENT = 'student'
|
||||||
ADMIN = 'admin'
|
ADMIN = 'admin'
|
||||||
SUPER_ADMIN = 's_admin'
|
SUPER_ADMIN = 's_admin'
|
||||||
|
SERVICE= 'service'
|
||||||
COMPANY = 'company'
|
COMPANY = 'company'
|
||||||
TIER = 'tier'
|
TIER = 'tier'
|
||||||
# To be Configured Properly
|
# To be Configured Properly
|
||||||
FOURTH_YEAR = '2020'
|
FOURTH_YEAR = '2021'
|
||||||
MAX_OFFERS_PER_STUDENT = 2
|
MAX_OFFERS_PER_STUDENT = 2
|
||||||
MAX_RESUMES_PER_STUDENT = 3
|
MAX_RESUMES_PER_STUDENT = 3
|
||||||
EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours
|
EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours
|
||||||
|
@ -93,6 +135,7 @@ JNF_SMALLTEXT_MAX_CHARACTER_COUNT = 50
|
||||||
STORAGE_DESTINATION_RESUMES = "./Storage/Resumes/"
|
STORAGE_DESTINATION_RESUMES = "./Storage/Resumes/"
|
||||||
STORAGE_DESTINATION_COMPANY_ATTACHMENTS = './Storage/Company_Attachments/'
|
STORAGE_DESTINATION_COMPANY_ATTACHMENTS = './Storage/Company_Attachments/'
|
||||||
STORAGE_DESTINATION_APPLICATION_CSV = './Storage/Application_CSV/'
|
STORAGE_DESTINATION_APPLICATION_CSV = './Storage/Application_CSV/'
|
||||||
|
STORAGE_DESTINATION_RESUME_ZIP = './Storage/Resume_Zips/'
|
||||||
|
|
||||||
TOKEN = 'token'
|
TOKEN = 'token'
|
||||||
RESUME_FILE_NAME = 'resume_file_name'
|
RESUME_FILE_NAME = 'resume_file_name'
|
||||||
|
@ -132,6 +175,7 @@ IS_DESCRIPTION_PDF = 'is_description_pdf'
|
||||||
OPENING_TYPE = 'opening_type'
|
OPENING_TYPE = 'opening_type'
|
||||||
JOB_LOCATION = 'job_location'
|
JOB_LOCATION = 'job_location'
|
||||||
COMPENSATION_CTC = 'compensation_ctc'
|
COMPENSATION_CTC = 'compensation_ctc'
|
||||||
|
COMPANY_TURNOVER = 'company_turnover' # newly added field
|
||||||
COMPENSATION_GROSS = 'compensation_gross'
|
COMPENSATION_GROSS = 'compensation_gross'
|
||||||
COMPENSATION_TAKE_HOME = 'compensation_take_home'
|
COMPENSATION_TAKE_HOME = 'compensation_take_home'
|
||||||
COMPENSATION_BONUS = 'compensation_bonus'
|
COMPENSATION_BONUS = 'compensation_bonus'
|
||||||
|
@ -141,7 +185,13 @@ COMPENSATION_DETAILS_PDF_NAMES = 'compensation_details_pdf_names'
|
||||||
IS_COMPENSATION_DETAILS_PDF = 'is_compensation_details_pdf'
|
IS_COMPENSATION_DETAILS_PDF = 'is_compensation_details_pdf'
|
||||||
ALLOWED_BATCH = 'allowed_batch'
|
ALLOWED_BATCH = 'allowed_batch'
|
||||||
ALLOWED_BRANCH = 'allowed_branch'
|
ALLOWED_BRANCH = 'allowed_branch'
|
||||||
RS_ELIGIBLE = 'rs_eligible'
|
# RS_ELIGIBLE = 'rs_eligible' removed
|
||||||
|
ELIGIBLESTUDENTS= 'eligiblestudents'# newly adde field
|
||||||
|
PWD_ELIGIBLE = 'pwd_eligible' # newly added field
|
||||||
|
BACKLOG_ELIGIBLE = 'backlog_eligible' # newly added field
|
||||||
|
PSYCHOMETRIC_TEST = 'pyschometric_test' # newly added field
|
||||||
|
MEDICAL_TEST = 'medical_test' # newly added field
|
||||||
|
CPI = 'cpi' # newly added field
|
||||||
BOND_DETAILS = 'bond_details'
|
BOND_DETAILS = 'bond_details'
|
||||||
SELECTION_PROCEDURE_ROUNDS = 'selection_procedure_rounds'
|
SELECTION_PROCEDURE_ROUNDS = 'selection_procedure_rounds'
|
||||||
SELECTION_PROCEDURE_DETAILS = 'selection_procedure_details'
|
SELECTION_PROCEDURE_DETAILS = 'selection_procedure_details'
|
||||||
|
@ -149,7 +199,10 @@ SELECTION_PROCEDURE_DETAILS_PDF = 'selection_procedure_details_pdf'
|
||||||
SELECTION_PROCEDURE_DETAILS_PDF_NAMES = 'selection_procedure_details_pdf_names'
|
SELECTION_PROCEDURE_DETAILS_PDF_NAMES = 'selection_procedure_details_pdf_names'
|
||||||
IS_SELECTION_PROCEDURE_DETAILS_PDF = 'is_selection_procedure_details_pdf'
|
IS_SELECTION_PROCEDURE_DETAILS_PDF = 'is_selection_procedure_details_pdf'
|
||||||
TENTATIVE_DATE_OF_JOINING = 'tentative_date_of_joining'
|
TENTATIVE_DATE_OF_JOINING = 'tentative_date_of_joining'
|
||||||
|
ESTABLISHMENT_DATE = 'establishment_date' # newly added field
|
||||||
TENTATIVE_NO_OF_OFFERS = 'tentative_no_of_offers'
|
TENTATIVE_NO_OF_OFFERS = 'tentative_no_of_offers'
|
||||||
|
EXPECTED_NO_OF_OFFERS = 'expected_no_of_offers' # newly added field
|
||||||
|
NUMBER_OF_EMPLOYEES = 'number_of_employees' # newly added field
|
||||||
OTHER_REQUIREMENTS = 'other_requirements'
|
OTHER_REQUIREMENTS = 'other_requirements'
|
||||||
DEADLINE_DATETIME = 'deadline_datetime'
|
DEADLINE_DATETIME = 'deadline_datetime'
|
||||||
OFFER_ACCEPTED = 'offer_accepted'
|
OFFER_ACCEPTED = 'offer_accepted'
|
||||||
|
@ -189,7 +242,9 @@ APPLICATION_CSV_COL_NAMES = ['Applied At', 'Roll No.', 'Name', 'Email', 'Phone N
|
||||||
'Resume', 'Selected', ]
|
'Resume', 'Selected', ]
|
||||||
|
|
||||||
|
|
||||||
|
ISSUE_SUBMITTED_TEMPLATE_SUBJECT = 'CDC - Issue Submitted'
|
||||||
|
STUDENT_ISSUE_SUBMITTED_TEMPLATE = 'student_issue_submitted.html'
|
||||||
|
REPS_ISSUE_SUBMITTED_TEMPLATE = 'reps_issue_submitted.html'
|
||||||
# Internships
|
# Internships
|
||||||
INTERNSHIP = 'Internship'
|
INTERNSHIP = 'Internship'
|
||||||
INTERNSHIP_ID = 'internship_id'
|
INTERNSHIP_ID = 'internship_id'
|
||||||
|
@ -206,6 +261,8 @@ STIPEND = 'stipend'
|
||||||
FACILITIES = 'facilities'
|
FACILITIES = 'facilities'
|
||||||
OTHER_FACILITIES = 'other_facilities'
|
OTHER_FACILITIES = 'other_facilities'
|
||||||
STIPEND_DETAILS_PDF = 'compensation_details_pdf'
|
STIPEND_DETAILS_PDF = 'compensation_details_pdf'
|
||||||
|
STIPEND_DETAILS_PDF_NAMES = 'stipend_description_pdf_names'
|
||||||
|
INTERNSHIP_OPENING_URL = "https://cdc.iitdh.ac.in/portal/student/dashboard/internships/{id}" # On frontend, this is the URL to be opened
|
||||||
|
|
||||||
SEASONS = (
|
SEASONS = (
|
||||||
'Summer',
|
'Summer',
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
from .models import *
|
||||||
|
from .utils import *
|
||||||
|
import shutil
|
||||||
|
import logging
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
logger=logging.getLogger('db')
|
||||||
|
def clean_up_tests():
|
||||||
|
# Delete all the test internships and placements created
|
||||||
|
try:
|
||||||
|
internships= Internship.objects.filter(company_name="test company",email="notifications@cdc-iitdh.tech")
|
||||||
|
hits_internship=len(internships)
|
||||||
|
for internship in internships:
|
||||||
|
#count number of file
|
||||||
|
files = os.listdir(STORAGE_DESTINATION_COMPANY_ATTACHMENTS+internship.id)
|
||||||
|
if len(files) == 4:
|
||||||
|
print("working fine")
|
||||||
|
else:
|
||||||
|
print("not working fine")
|
||||||
|
logger.error("files submitted in inf are not getting stored for test case"+internship.description)
|
||||||
|
|
||||||
|
#remove folder from the server
|
||||||
|
print("removing folder ",STORAGE_DESTINATION_COMPANY_ATTACHMENTS+internship.id)
|
||||||
|
shutil.rmtree(STORAGE_DESTINATION_COMPANY_ATTACHMENTS+internship.id)
|
||||||
|
|
||||||
|
|
||||||
|
internship.delete()
|
||||||
|
|
||||||
|
placements= Placement.objects.filter(company_name="test company",email="notifications@cdc-iitdh.tech")
|
||||||
|
hits_placement=len(placements)
|
||||||
|
for placement in placements:
|
||||||
|
#count number of file
|
||||||
|
files = os.listdir(STORAGE_DESTINATION_COMPANY_ATTACHMENTS+placement.id)
|
||||||
|
if len(files) == 4:
|
||||||
|
print("working fine")
|
||||||
|
else:
|
||||||
|
print("not working fine")
|
||||||
|
logger.error("files submitted in inf are not getting stored for test case"+placement.description)
|
||||||
|
|
||||||
|
#remove folder from the server
|
||||||
|
print("removing folder ",STORAGE_DESTINATION_COMPANY_ATTACHMENTS+internship.id)
|
||||||
|
shutil.rmtree(STORAGE_DESTINATION_COMPANY_ATTACHMENTS+placement.id)
|
||||||
|
|
||||||
|
|
||||||
|
placement.delete()
|
||||||
|
|
||||||
|
if hits_internship >= 6:
|
||||||
|
print("all hits are working fine")
|
||||||
|
else:
|
||||||
|
print("some hits are not working fine")
|
||||||
|
logger.error("some test hits are not working fine for internship")
|
||||||
|
|
||||||
|
if hits_placement >= 6:
|
||||||
|
print("all hits are working fine")
|
||||||
|
else:
|
||||||
|
print("some hits are not working fine")
|
||||||
|
logger.error("some test hits are not working fine for placement")
|
||||||
|
|
||||||
|
except :
|
||||||
|
logger.error("error in clean up function")
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
|
|
|
@ -23,17 +23,20 @@ class User(models.Model):
|
||||||
|
|
||||||
class Student(models.Model):
|
class Student(models.Model):
|
||||||
id = models.CharField(blank=False, max_length=15, primary_key=True)
|
id = models.CharField(blank=False, max_length=15, primary_key=True)
|
||||||
roll_no = models.IntegerField(blank=False)
|
roll_no = models.CharField(blank=False, max_length=15, unique=True)
|
||||||
name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
|
name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
|
||||||
batch = models.CharField(max_length=10, choices=BATCH_CHOICES, blank=False)
|
batch = models.CharField(max_length=10, choices=BATCH_CHOICES, blank=False)
|
||||||
branch = models.CharField(choices=BRANCH_CHOICES, blank=False, max_length=10)
|
branch = models.CharField(choices=BRANCH_CHOICES, blank=True,default=None, null=True, max_length=10)
|
||||||
phone_number = models.PositiveBigIntegerField(blank=True, default=None, null=True)
|
phone_number = models.PositiveBigIntegerField(blank=True, default=None, null=True)
|
||||||
resumes = ArrayField(models.CharField(null=True, default=None, max_length=JNF_TEXT_MAX_CHARACTER_COUNT), size=10,
|
resumes = ArrayField(models.CharField(null=True, default=None, max_length=JNF_TEXT_MAX_CHARACTER_COUNT), size=10,
|
||||||
default=list, blank=True)
|
default=list, blank=True)
|
||||||
cpi = models.DecimalField(decimal_places=2, max_digits=4)
|
cpi = models.DecimalField(decimal_places=2, max_digits=4)
|
||||||
can_apply = models.BooleanField(default=True, verbose_name='Registered')
|
can_apply = models.BooleanField(default=True, verbose_name='Registered')
|
||||||
|
can_apply_internship = models.BooleanField(default=True, verbose_name='Internship Registered')
|
||||||
changed_by = models.ForeignKey(User, blank=True, on_delete=models.RESTRICT, default=None, null=True)
|
changed_by = models.ForeignKey(User, blank=True, on_delete=models.RESTRICT, default=None, null=True)
|
||||||
degree = models.CharField(choices=DEGREE_CHOICES, blank=False, max_length=10, default=DEGREE_CHOICES[0][0])
|
degree = models.CharField(choices=ELIGIBLE_CHOICES, blank=False, max_length=10, default=ELIGIBLE_CHOICES[0][0]) # should be ELIGIBLE_CHOICES
|
||||||
|
isPwd = models.BooleanField(default=False, verbose_name='Person with Disability')
|
||||||
|
isBacklog = models.BooleanField(default=False, verbose_name='Has Backlog')
|
||||||
history = HistoricalRecords(user_model=User)
|
history = HistoricalRecords(user_model=User)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -89,13 +92,14 @@ class Placement(models.Model):
|
||||||
default=list, blank=True)
|
default=list, blank=True)
|
||||||
is_company_details_pdf = models.BooleanField(blank=False, default=False)
|
is_company_details_pdf = models.BooleanField(blank=False, default=False)
|
||||||
contact_person_name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
|
contact_person_name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
|
||||||
phone_number = models.PositiveBigIntegerField(blank=False)
|
phone_number = models.CharField(max_length=15, blank=False)
|
||||||
email = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
email = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
||||||
city = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
city = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
||||||
state = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
state = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
||||||
country = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
country = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
||||||
pin_code = models.IntegerField(blank=False, default=None, null=True)
|
pin_code = models.IntegerField(blank=False, default=None, null=True)
|
||||||
city_type = models.CharField(blank=False, max_length=15, choices=OFFER_CITY_TYPE)
|
city_type = models.CharField(blank=False, max_length=15, choices=OFFER_CITY_TYPE)
|
||||||
|
cpi_eligible = models.DecimalField(decimal_places=2, default=0.00, max_digits=4) #newly added field
|
||||||
# Job Details
|
# Job Details
|
||||||
designation = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT, default=None, null=True)
|
designation = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT, default=None, null=True)
|
||||||
description = models.CharField(blank=False, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
description = models.CharField(blank=False, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
||||||
|
@ -105,6 +109,7 @@ class Placement(models.Model):
|
||||||
blank=True)
|
blank=True)
|
||||||
is_description_pdf = models.BooleanField(blank=False, default=False)
|
is_description_pdf = models.BooleanField(blank=False, default=False)
|
||||||
compensation_CTC = models.IntegerField(blank=False, default=None, null=True) # Job - Per Year
|
compensation_CTC = models.IntegerField(blank=False, default=None, null=True) # Job - Per Year
|
||||||
|
company_turnover = models.IntegerField(blank=True, default=None, null=True) # newly added field
|
||||||
compensation_gross = models.IntegerField(blank=False, default=None, null=True)
|
compensation_gross = models.IntegerField(blank=False, default=None, null=True)
|
||||||
compensation_take_home = models.IntegerField(blank=False, default=None, null=True)
|
compensation_take_home = models.IntegerField(blank=False, default=None, null=True)
|
||||||
compensation_bonus = models.IntegerField(blank=True, default=None, null=True)
|
compensation_bonus = models.IntegerField(blank=True, default=None, null=True)
|
||||||
|
@ -123,6 +128,7 @@ class Placement(models.Model):
|
||||||
is_selection_procedure_details_pdf = models.BooleanField(blank=False, default=False)
|
is_selection_procedure_details_pdf = models.BooleanField(blank=False, default=False)
|
||||||
tier = models.CharField(blank=False, choices=TIERS, max_length=10, default=None, null=True)
|
tier = models.CharField(blank=False, choices=TIERS, max_length=10, default=None, null=True)
|
||||||
tentative_date_of_joining = models.DateField(blank=False, verbose_name="Tentative Date", default=timezone.now)
|
tentative_date_of_joining = models.DateField(blank=False, verbose_name="Tentative Date", default=timezone.now)
|
||||||
|
establishment_date = models.DateField(blank=True, default=None, null=True) # newly added field
|
||||||
allowed_batch = ArrayField(
|
allowed_batch = ArrayField(
|
||||||
models.CharField(max_length=10, choices=BATCH_CHOICES),
|
models.CharField(max_length=10, choices=BATCH_CHOICES),
|
||||||
size=TOTAL_BATCHES,
|
size=TOTAL_BATCHES,
|
||||||
|
@ -135,7 +141,17 @@ class Placement(models.Model):
|
||||||
default=list
|
default=list
|
||||||
)
|
)
|
||||||
tentative_no_of_offers = models.IntegerField(blank=False, default=None, null=True)
|
tentative_no_of_offers = models.IntegerField(blank=False, default=None, null=True)
|
||||||
rs_eligible = models.BooleanField(blank=False, default=False)
|
expected_no_of_offers = models.IntegerField(blank=False , default=None , null=True) # newly added
|
||||||
|
number_of_employees = models.IntegerField(blank=True, default=None, null=True) # newly added field
|
||||||
|
eligiblestudents = ArrayField(
|
||||||
|
models.CharField(choices=ELIGIBLE_CHOICES, blank=False, max_length=10),
|
||||||
|
size=10,
|
||||||
|
default=list
|
||||||
|
) #newly added field
|
||||||
|
pwd_eligible = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
|
backlog_eligible = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
|
psychometric_test = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
|
medical_test = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
other_requirements = models.CharField(blank=True, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default="")
|
other_requirements = models.CharField(blank=True, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default="")
|
||||||
additional_info = ArrayField(models.CharField(blank=True, max_length=JNF_TEXTMEDIUM_MAX_CHARACTER_COUNT), size=15,
|
additional_info = ArrayField(models.CharField(blank=True, max_length=JNF_TEXTMEDIUM_MAX_CHARACTER_COUNT), size=15,
|
||||||
default=list, blank=True)
|
default=list, blank=True)
|
||||||
|
@ -318,9 +334,26 @@ class Internship(models.Model):
|
||||||
size=TOTAL_BRANCHES,
|
size=TOTAL_BRANCHES,
|
||||||
default=list
|
default=list
|
||||||
)
|
)
|
||||||
sophomore_eligible = models.BooleanField(blank=False, default=False)
|
allowed_batch = ArrayField(
|
||||||
rs_eligible = models.BooleanField(blank=False, default=False)
|
models.CharField(max_length=10, choices=BATCH_CHOICES),
|
||||||
tentative_no_of_offers = models.IntegerField(blank=False, default=None, null=True)
|
size=TOTAL_BATCHES,
|
||||||
|
default=list
|
||||||
|
)
|
||||||
|
eligiblestudents = ArrayField(
|
||||||
|
models.CharField(choices=ELIGIBLE_CHOICES, blank=False, max_length=10),
|
||||||
|
size=10,
|
||||||
|
default=list
|
||||||
|
)
|
||||||
|
tentative_no_of_offers = models.IntegerField(blank=False, default=None, null=True)
|
||||||
|
company_turnover = models.IntegerField(blank=True, default=None, null=True) # newly added field
|
||||||
|
establishment_date = models.DateField(blank=True, default=None, null=True) # newly added field
|
||||||
|
expected_no_of_offers = models.IntegerField(blank=True , default=None , null=True) # newly added
|
||||||
|
number_of_employees = models.IntegerField(blank=True, default=None, null=True) # newly added field
|
||||||
|
pwd_eligible = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
|
backlog_eligible = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
|
psychometric_test = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
|
medical_test = models.BooleanField(blank=True, default=False) #newly added field
|
||||||
|
cpi_eligible = models.DecimalField(decimal_places=2, default=0.00, max_digits=4) #newly added field
|
||||||
is_stipend_description_pdf = models.BooleanField(blank=False, default=False)
|
is_stipend_description_pdf = models.BooleanField(blank=False, default=False)
|
||||||
stipend_description_pdf_names=ArrayField(
|
stipend_description_pdf_names=ArrayField(
|
||||||
models.CharField(null=True, default=None, max_length=JNF_TEXT_MAX_CHARACTER_COUNT), size=5, default=list,
|
models.CharField(null=True, default=None, max_length=JNF_TEXT_MAX_CHARACTER_COUNT), size=5, default=list,
|
||||||
|
@ -332,6 +365,11 @@ class Internship(models.Model):
|
||||||
default=list,
|
default=list,
|
||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
|
additional_info = ArrayField(models.CharField(blank=True, max_length=JNF_TEXTMEDIUM_MAX_CHARACTER_COUNT), size=15,
|
||||||
|
default=list, blank=True)
|
||||||
|
offer_accepted = models.BooleanField(blank=False, default=None, null=True)
|
||||||
|
deadline_datetime = models.DateTimeField(blank=False, verbose_name="Deadline Date", default=two_day_after_today)
|
||||||
|
|
||||||
additional_facilities = models.CharField(blank=True, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
additional_facilities = models.CharField(blank=True, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
||||||
academic_requirements = models.CharField(blank=True, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
academic_requirements = models.CharField(blank=True, max_length=JNF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
||||||
# selection process
|
# selection process
|
||||||
|
@ -345,7 +383,7 @@ class Internship(models.Model):
|
||||||
is_selection_procedure_details_pdf = models.BooleanField(blank=False, default=False)
|
is_selection_procedure_details_pdf = models.BooleanField(blank=False, default=False)
|
||||||
#contact details of company person
|
#contact details of company person
|
||||||
contact_person_name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
|
contact_person_name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
|
||||||
phone_number = models.PositiveBigIntegerField(blank=False)
|
phone_number = models.CharField(max_length=15, blank=False)
|
||||||
email = models.EmailField(blank=False)
|
email = models.EmailField(blank=False)
|
||||||
# contact_person_designation = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
# contact_person_designation = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
||||||
# telephone_number = models.PositiveBigIntegerField(blank=True, default=None, null=True)
|
# telephone_number = models.PositiveBigIntegerField(blank=True, default=None, null=True)
|
||||||
|
@ -388,6 +426,9 @@ class Internship(models.Model):
|
||||||
self.additional_facilities = self.additional_facilities.strip()[:JNF_TEXTAREA_MAX_CHARACTER_COUNT]
|
self.additional_facilities = self.additional_facilities.strip()[:JNF_TEXTAREA_MAX_CHARACTER_COUNT]
|
||||||
if self.academic_requirements is not None:
|
if self.academic_requirements is not None:
|
||||||
self.academic_requirements = self.academic_requirements.strip()[:JNF_TEXTAREA_MAX_CHARACTER_COUNT]
|
self.academic_requirements = self.academic_requirements.strip()[:JNF_TEXTAREA_MAX_CHARACTER_COUNT]
|
||||||
|
if self.additional_info is not None:
|
||||||
|
self.additional_info = [info.strip()[:JNF_TEXTMEDIUM_MAX_CHARACTER_COUNT] for info in
|
||||||
|
list(self.additional_info)]
|
||||||
# if self.contact_person_designation is not None:
|
# if self.contact_person_designation is not None:
|
||||||
# self.contact_person_designation = self.contact_person_designation.strip()[:JNF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
# self.contact_person_designation = self.contact_person_designation.strip()[:JNF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
||||||
|
|
||||||
|
@ -421,6 +462,7 @@ class InternshipApplication(models.Model):
|
||||||
resume = models.CharField(max_length=JNF_TEXT_MAX_CHARACTER_COUNT, blank=False, null=True, default=None)
|
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)
|
additional_info = models.JSONField(blank=True, null=True, default=None)
|
||||||
selected = models.BooleanField(null=True, default=None, blank=True)
|
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
|
||||||
stipend = models.IntegerField(blank=True, default=None, null=True)
|
stipend = models.IntegerField(blank=True, default=None, null=True)
|
||||||
applied_at = models.DateTimeField(blank=False, default=None, null=True)
|
applied_at = models.DateTimeField(blank=False, default=None, null=True)
|
||||||
updated_at = models.DateTimeField(blank=False, default=None, null=True)
|
updated_at = models.DateTimeField(blank=False, default=None, null=True)
|
||||||
|
@ -464,4 +506,33 @@ class Contributor(models.Model):
|
||||||
image = models.CharField(max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, blank=False, default="", null=True)
|
image = models.CharField(max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, blank=False, default="", null=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
class Issues(models.Model):
|
||||||
|
id = models.AutoField(primary_key=True)
|
||||||
|
title = models.CharField(max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, blank=False, default="")
|
||||||
|
description = models.CharField(max_length=200, blank=False, default="")
|
||||||
|
#opening=(models.ForeignKey(Placement, on_delete=models.CASCADE, blank=False) or models.ForeignKey(Internship, on_delete=models.CASCADE, blank=False))
|
||||||
|
opening_id=models.CharField(blank=False, max_length=15, default=None, null=True)
|
||||||
|
opening_type=models.CharField(choices=[('Placement','Placement'),('Internship','Internship')], blank=False, max_length=15, default=PLACEMENT)
|
||||||
|
#status = models.CharField(max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, blank=False, default="")
|
||||||
|
student=models.ForeignKey(Student, on_delete=models.CASCADE, blank=False)
|
||||||
|
created_at = models.DateTimeField(blank=False, default=None, null=True)
|
||||||
|
updated_at = models.DateTimeField(blank=False, default=None, null=True)
|
||||||
|
changed_by = models.ForeignKey(User, on_delete=models.RESTRICT, blank=True, null=True)
|
||||||
|
history = HistoricalRecords(user_model=User)
|
||||||
|
|
||||||
|
def save(self, *args, **kwargs):
|
||||||
|
''' On save, add timestamps '''
|
||||||
|
if not self.created_at:
|
||||||
|
self.created_at = timezone.now()
|
||||||
|
self.updated_at = timezone.now()
|
||||||
|
|
||||||
|
return super(Issues, self).save(*args, **kwargs)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.title + " - " + self.student.name
|
||||||
|
class Meta:
|
||||||
|
verbose_name_plural = "Issues"
|
||||||
|
|
|
@ -99,6 +99,59 @@ class PlacementSerializerForStudent(serializers.ModelSerializer):
|
||||||
]
|
]
|
||||||
depth = 1
|
depth = 1
|
||||||
|
|
||||||
|
class InternshipSerializerForStudent(serializers.ModelSerializer):
|
||||||
|
company_details_pdf_links = serializers.SerializerMethodField()
|
||||||
|
description_pdf_links = serializers.SerializerMethodField()
|
||||||
|
compensation_pdf_links = serializers.SerializerMethodField()
|
||||||
|
selection_procedure_details_pdf_links = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
def get_company_details_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.company_details_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
|
||||||
|
def get_description_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.description_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
def get_compensation_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.stipend_description_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
|
||||||
|
def get_selection_procedure_details_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.selection_procedure_details_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Internship
|
||||||
|
exclude = [CONTACT_PERSON_NAME, PHONE_NUMBER, EMAIL, COMPANY_DETAILS_PDF_NAMES, DESCRIPTION_PDF_NAMES,
|
||||||
|
STIPEND_DETAILS_PDF_NAMES, SELECTION_PROCEDURE_DETAILS_PDF_NAMES, OFFER_ACCEPTED,
|
||||||
|
EMAIL_VERIFIED,
|
||||||
|
]
|
||||||
|
depth = 1
|
||||||
|
|
||||||
|
|
||||||
class PlacementSerializerForAdmin(serializers.ModelSerializer):
|
class PlacementSerializerForAdmin(serializers.ModelSerializer):
|
||||||
company_details_pdf_links = serializers.SerializerMethodField()
|
company_details_pdf_links = serializers.SerializerMethodField()
|
||||||
|
@ -152,6 +205,58 @@ class PlacementSerializerForAdmin(serializers.ModelSerializer):
|
||||||
COMPENSATION_DETAILS_PDF_NAMES, SELECTION_PROCEDURE_DETAILS_PDF_NAMES]
|
COMPENSATION_DETAILS_PDF_NAMES, SELECTION_PROCEDURE_DETAILS_PDF_NAMES]
|
||||||
depth = 1
|
depth = 1
|
||||||
|
|
||||||
|
class InternshipSerializerForAdmin(serializers.ModelSerializer):
|
||||||
|
company_details_pdf_links = serializers.SerializerMethodField()
|
||||||
|
description_pdf_links = serializers.SerializerMethodField()
|
||||||
|
compensation_pdf_links = serializers.SerializerMethodField()
|
||||||
|
selection_procedure_details_pdf_links = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
def get_company_details_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.company_details_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
|
||||||
|
def get_description_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.description_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
|
||||||
|
def get_compensation_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.stipend_description_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
|
||||||
|
def get_selection_procedure_details_pdf_links(self, obj):
|
||||||
|
links = []
|
||||||
|
for pdf_name in obj.selection_procedure_details_pdf_names:
|
||||||
|
ele = {}
|
||||||
|
link = LINK_TO_STORAGE_COMPANY_ATTACHMENT + urllib.parse.quote(obj.id + "/" + pdf_name)
|
||||||
|
ele['link'] = link
|
||||||
|
ele['name'] = pdf_name
|
||||||
|
links.append(ele)
|
||||||
|
return links
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Internship
|
||||||
|
exclude = [COMPANY_DETAILS_PDF_NAMES, DESCRIPTION_PDF_NAMES, SELECTION_PROCEDURE_DETAILS_PDF_NAMES,
|
||||||
|
STIPEND_DETAILS_PDF_NAMES]
|
||||||
|
depth = 1
|
||||||
|
|
||||||
|
|
||||||
class PlacementApplicationSerializer(serializers.ModelSerializer):
|
class PlacementApplicationSerializer(serializers.ModelSerializer):
|
||||||
placement = serializers.SerializerMethodField()
|
placement = serializers.SerializerMethodField()
|
||||||
|
@ -168,6 +273,21 @@ class PlacementApplicationSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PlacementApplication
|
model = PlacementApplication
|
||||||
exclude = [STUDENT, 'resume']
|
exclude = [STUDENT, 'resume']
|
||||||
|
class InternshipApplicationSerializer(serializers.ModelSerializer):
|
||||||
|
internship = serializers.SerializerMethodField()
|
||||||
|
resume_link = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
def get_internship(self, obj):
|
||||||
|
data = InternshipSerializerForStudent(obj.internship).data
|
||||||
|
return data
|
||||||
|
|
||||||
|
def get_resume_link(self, obj):
|
||||||
|
ele = {'link': LINK_TO_STORAGE_RESUME + urllib.parse.quote(str(obj.student.roll_no) + "/" + obj.resume), 'name': obj.resume}
|
||||||
|
return ele
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = InternshipApplication
|
||||||
|
exclude = [STUDENT, 'resume']
|
||||||
|
|
||||||
|
|
||||||
class PlacementApplicationSerializerForAdmin(serializers.ModelSerializer):
|
class PlacementApplicationSerializerForAdmin(serializers.ModelSerializer):
|
||||||
|
@ -186,6 +306,22 @@ class PlacementApplicationSerializerForAdmin(serializers.ModelSerializer):
|
||||||
model = PlacementApplication
|
model = PlacementApplication
|
||||||
exclude = ['placement', 'resume']
|
exclude = ['placement', 'resume']
|
||||||
|
|
||||||
|
class InternshipApplicationSerializerForAdmin(serializers.ModelSerializer):
|
||||||
|
student_details = serializers.SerializerMethodField()
|
||||||
|
resume_link = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
def get_student_details(self, obj):
|
||||||
|
data = StudentSerializer(obj.student).data
|
||||||
|
return data
|
||||||
|
|
||||||
|
def get_resume_link(self, obj):
|
||||||
|
ele = {'link': LINK_TO_STORAGE_RESUME + urllib.parse.quote(obj.id + "/" + obj.resume), 'name': obj.resume}
|
||||||
|
return ele
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = InternshipApplication
|
||||||
|
exclude = ['internship', 'resume']
|
||||||
|
|
||||||
class ContributorSerializer(serializers.ModelSerializer):
|
class ContributorSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Contributor
|
model = Contributor
|
||||||
|
@ -195,4 +331,9 @@ class ContributorSerializer(serializers.ModelSerializer):
|
||||||
class AutofillSerializers(serializers.ModelSerializer):
|
class AutofillSerializers(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Placement
|
model = Placement
|
||||||
|
fields = '__all__'
|
||||||
|
|
||||||
|
class AutofillSerializersInternship(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = Internship
|
||||||
fields = '__all__'
|
fields = '__all__'
|
|
@ -3,13 +3,14 @@ from django.urls import path
|
||||||
from . import studentViews
|
from . import studentViews
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('login/', studentViews.login, name="Login"),
|
path('login/', studentViews.login, name="Login"),
|
||||||
path('profile/', studentViews.studentProfile, name="Student Profile"),
|
path('profile/', studentViews.studentProfile, name="Student Profile"),
|
||||||
path('getDashboard/', studentViews.getDashboard, name="Dashboard"),
|
path('getDashboard/', studentViews.getDashboard, name="Dashboard"),
|
||||||
path("addResume/", studentViews.addResume, name="Upload Resume"),
|
path("addResume/", studentViews.addResume, name="Upload Resume"),
|
||||||
path("deleteResume/", studentViews.deleteResume, name="Upload Resume"),
|
path("deleteResume/", studentViews.deleteResume, name="Delete Resume"),
|
||||||
path("submitApplication/", studentViews.submitApplication, name="Submit Application"),
|
path("submitApplication/", studentViews.submitApplication, name="Add Application"),
|
||||||
path("deleteApplication/", studentViews.deleteApplication, name="Delete Application"),
|
path("deleteApplication/", studentViews.deleteApplication, name="Delete Application"),
|
||||||
path("getContributorStats/", studentViews.getContributorStats, name="Get Contributor Stats"),
|
path("getContributorStats/", studentViews.getContributorStats, name="Get Contributor Stats"),
|
||||||
path("studentAcceptOffer/", studentViews.studentAcceptOffer, name="Student Accept Offer"),
|
path("studentAcceptOffer/", studentViews.studentAcceptOffer, name="Student Accept Offer"),
|
||||||
|
path("addIssue/",studentViews.addIssue,name= "Add Issue")
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
from datetime import datetime as dt
|
||||||
from rest_framework.decorators import api_view
|
from rest_framework.decorators import api_view
|
||||||
|
from django.db.models import Q
|
||||||
|
|
||||||
from .serializers import *
|
from .serializers import *
|
||||||
from .utils import *
|
from .utils import *
|
||||||
|
@ -48,6 +50,7 @@ def refresh(request):
|
||||||
@isAuthorized(allowed_users=[STUDENT])
|
@isAuthorized(allowed_users=[STUDENT])
|
||||||
def studentProfile(request, id, email, user_type):
|
def studentProfile(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
studentDetails = get_object_or_404(Student, id=id)
|
studentDetails = get_object_or_404(Student, id=id)
|
||||||
|
|
||||||
data = StudentSerializer(studentDetails).data
|
data = StudentSerializer(studentDetails).data
|
||||||
|
@ -100,19 +103,42 @@ def getDashboard(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
studentDetails = get_object_or_404(Student, id=id)
|
studentDetails = get_object_or_404(Student, id=id)
|
||||||
|
|
||||||
placements = Placement.objects.filter(allowed_batch__contains=[studentDetails.batch],
|
filters = Q(
|
||||||
allowed_branch__contains=[studentDetails.branch],
|
allowed_branch__contains=[studentDetails.branch],
|
||||||
deadline_datetime__gte=datetime.datetime.now(),
|
eligiblestudents__contains=[studentDetails.degree],
|
||||||
offer_accepted=True, email_verified=True).order_by('deadline_datetime')
|
deadline_datetime__gte=dt.now(),
|
||||||
filtered_placements = placement_eligibility_filters(studentDetails, placements)
|
offer_accepted=True,
|
||||||
|
email_verified=True
|
||||||
|
)
|
||||||
|
|
||||||
|
if studentDetails.degree == 'Btech':
|
||||||
|
filters &= Q(allowed_batch__contains=[studentDetails.batch])
|
||||||
|
|
||||||
|
placements = Placement.objects.filter(filters).order_by('deadline_datetime')
|
||||||
|
filtered_placements = placement_eligibility_filters(studentDetails, placements)
|
||||||
placementsdata = PlacementSerializerForStudent(filtered_placements, many=True).data
|
placementsdata = PlacementSerializerForStudent(filtered_placements, many=True).data
|
||||||
|
|
||||||
placementApplications = PlacementApplication.objects.filter(student_id=id)
|
placementApplications = PlacementApplication.objects.filter(student_id=id).order_by('-updated_at')
|
||||||
placementApplications = PlacementApplicationSerializer(placementApplications, many=True).data
|
placementApplications = PlacementApplicationSerializer(placementApplications, many=True).data
|
||||||
|
if studentDetails.degree == 'BSMS': # for BSMS branch is not considered
|
||||||
|
internships = Internship.objects.filter(
|
||||||
|
allowed_batch__contains=[studentDetails.batch],
|
||||||
|
deadline_datetime__gte=datetime.datetime.now(),
|
||||||
|
offer_accepted=True,
|
||||||
|
email_verified=True
|
||||||
|
).order_by('deadline_datetime')
|
||||||
|
else:
|
||||||
|
internships = Internship.objects.filter(filters).order_by('deadline_datetime')
|
||||||
|
|
||||||
|
|
||||||
|
filtered_internships = internship_eligibility_filters(studentDetails, internships)
|
||||||
|
internshipsdata = InternshipSerializerForStudent(filtered_internships, many=True).data
|
||||||
|
|
||||||
|
internshipApplications = InternshipApplication.objects.filter(student_id=id).order_by('-updated_at')
|
||||||
|
internshipApplications = InternshipApplicationSerializer(internshipApplications, many=True).data
|
||||||
return Response(
|
return Response(
|
||||||
{'action': "Get Dashboard - Student", 'message': "Data Found", "placements": placementsdata,
|
{'action': "Get Dashboard - Student", 'message': "Data Found", "placements": placementsdata,
|
||||||
'placementApplication': placementApplications},
|
'placementApplication': placementApplications, 'internships':internshipsdata,'internshipApplication':internshipApplications},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except Http404:
|
except Http404:
|
||||||
return Response({'action': "Get Dashboard - Student", 'message': 'Student Not Found'},
|
return Response({'action': "Get Dashboard - Student", 'message': 'Student Not Found'},
|
||||||
|
@ -159,25 +185,29 @@ def deleteResume(request, id, email, user_type):
|
||||||
|
|
||||||
@api_view(['POST'])
|
@api_view(['POST'])
|
||||||
@isAuthorized(allowed_users=[STUDENT])
|
@isAuthorized(allowed_users=[STUDENT])
|
||||||
@precheck(required_data=[OPENING_TYPE, OPENING_ID, RESUME_FILE_NAME,
|
@precheck(required_data=[OPENING_TYPE, OPENING_ID, RESUME_FILE_NAME,ADDITIONAL_INFO
|
||||||
])
|
])
|
||||||
def submitApplication(request, id, email, user_type):
|
def submitApplication(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
student = get_object_or_404(Student, id=id)
|
student = get_object_or_404(Student, id=id)
|
||||||
if not student.can_apply:
|
|
||||||
return Response({'action': "Submit Application", 'message': "Student Can't Apply"},
|
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
|
||||||
# Only Allowing Applications for Placements
|
# Only Allowing Applications for Placements
|
||||||
if data[OPENING_TYPE] == PLACEMENT:
|
if data[OPENING_TYPE] == PLACEMENT:
|
||||||
|
if not student.can_apply:
|
||||||
|
return Response({'action': "Submit Application", 'message': "Student Can't Apply"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
if not len(PlacementApplication.objects.filter(
|
if not len(PlacementApplication.objects.filter(
|
||||||
student_id=id, placement_id=data[OPENING_ID])):
|
student_id=id, placement_id=data[OPENING_ID])):
|
||||||
application = PlacementApplication()
|
application = PlacementApplication()
|
||||||
opening = get_object_or_404(Placement, id=data[OPENING_ID],
|
application_filters = Q(
|
||||||
allowed_batch__contains=[student.batch],
|
id=data[OPENING_ID],
|
||||||
allowed_branch__contains=[student.branch],
|
allowed_branch__contains=[student.branch],
|
||||||
deadline_datetime__gte=datetime.datetime.now().date()
|
deadline_datetime__gte=timezone.now()
|
||||||
)
|
)
|
||||||
|
if student.degree == "Btech":
|
||||||
|
application_filters &= Q(allowed_batch__contains=[student.batch])
|
||||||
|
opening = get_object_or_404(Placement.objects.filter(application_filters))
|
||||||
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")
|
||||||
|
|
||||||
|
@ -187,6 +217,30 @@ def submitApplication(request, id, email, user_type):
|
||||||
application.placement = opening
|
application.placement = opening
|
||||||
else:
|
else:
|
||||||
raise PermissionError("Application is already Submitted")
|
raise PermissionError("Application is already Submitted")
|
||||||
|
elif data[OPENING_TYPE] == INTERNSHIP:
|
||||||
|
if not student.can_apply_internship:
|
||||||
|
return Response({'action': "Submit Application", 'message': "Student Can't Apply"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
if not len(InternshipApplication.objects.filter(
|
||||||
|
student_id=id, internship_id=data[OPENING_ID])):
|
||||||
|
application = InternshipApplication()
|
||||||
|
application_filters = Q(
|
||||||
|
id=data[OPENING_ID],
|
||||||
|
allowed_branch__contains=[student.branch],
|
||||||
|
deadline_datetime__gte=timezone.now()
|
||||||
|
)
|
||||||
|
if student.degree == "Btech":
|
||||||
|
application_filters &= Q(allowed_batch__contains=[student.batch])
|
||||||
|
opening = get_object_or_404(Internship.objects.filter(application_filters))
|
||||||
|
if not opening.offer_accepted or not opening.email_verified:
|
||||||
|
raise PermissionError("Internship Not Approved")
|
||||||
|
|
||||||
|
cond_stat, cond_msg = InternshipApplicationConditions(student, opening)
|
||||||
|
if not cond_stat:
|
||||||
|
raise PermissionError(cond_msg)
|
||||||
|
application.internship = opening
|
||||||
|
else:
|
||||||
|
raise PermissionError("Application is already Submitted")
|
||||||
else:
|
else:
|
||||||
raise ValueError(OPENING_TYPE + " is Invalid")
|
raise ValueError(OPENING_TYPE + " is Invalid")
|
||||||
|
|
||||||
|
@ -239,10 +293,22 @@ def submitApplication(request, id, email, user_type):
|
||||||
def deleteApplication(request, id, email, user_type):
|
def deleteApplication(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
application = get_object_or_404(PlacementApplication, id=data[APPLICATION_ID],
|
if OPENING_TYPE in request.data:
|
||||||
|
opening_type = request.data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type = PLACEMENT
|
||||||
|
if opening_type==INTERNSHIP: #check whether it has header or not
|
||||||
|
application = get_object_or_404(InternshipApplication, id=data[APPLICATION_ID],
|
||||||
student_id=id)
|
student_id=id)
|
||||||
if application.placement.deadline_datetime < timezone.now():
|
if application.internship.deadline_datetime < timezone.now():
|
||||||
raise PermissionError("Deadline Passed")
|
raise PermissionError("Deadline Passed")
|
||||||
|
else:
|
||||||
|
application = get_object_or_404(PlacementApplication, id=data[APPLICATION_ID],
|
||||||
|
student_id=id)
|
||||||
|
if application.placement.deadline_datetime < timezone.now():
|
||||||
|
raise PermissionError("Deadline Passed")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
application.delete()
|
application.delete()
|
||||||
return Response({'action': "Delete Application", 'message': "Application Deleted"},
|
return Response({'action': "Delete Application", 'message': "Application Deleted"},
|
||||||
|
@ -277,19 +343,86 @@ def getContributorStats(request, id, email, user_type):
|
||||||
|
|
||||||
#view for sudentAcceptOffer
|
#view for sudentAcceptOffer
|
||||||
@api_view(['POST'])
|
@api_view(['POST'])
|
||||||
|
@precheck(required_data=[OPENING_ID,"offer_accepted"])
|
||||||
@isAuthorized(allowed_users=[STUDENT])
|
@isAuthorized(allowed_users=[STUDENT])
|
||||||
def studentAcceptOffer(request, id, email, user_type):
|
def studentAcceptOffer(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
company_id = request.data['id']
|
company_id = request.data[OPENING_ID]
|
||||||
student_id=request.data['profileInfo']['id']
|
#student_id=request.data['profileInfo']['id'] //check this once
|
||||||
offer_status = request.data['offerStatus']
|
student_id=id
|
||||||
placement_application=PlacementApplication.objects.get(placement=company_id,student=student_id)
|
|
||||||
placement_application.offer_accepted=offer_status
|
offer_accepted = request.data['offer_accepted']
|
||||||
placement_application.save()
|
if OPENING_TYPE in request.data:
|
||||||
return Response({'action': "Accept Offer", 'message': "Updated Offer Status"},
|
opening_type = request.data[OPENING_TYPE]
|
||||||
|
else:
|
||||||
|
opening_type = PLACEMENT
|
||||||
|
if opening_type==INTERNSHIP:
|
||||||
|
application=InternshipApplication.objects.filter(internship=company_id,student=student_id,selected=True)
|
||||||
|
else:
|
||||||
|
application=PlacementApplication.objects.filter(placement=company_id,student=student_id,selected=True)
|
||||||
|
|
||||||
|
if len(application):
|
||||||
|
application[0].offer_accepted=offer_accepted
|
||||||
|
application[0].save()
|
||||||
|
return Response({'action': "Accept Offer", 'message': "Updated Offer Status"},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
|
else:
|
||||||
|
return Response({'action': "Accept Offer", 'message': "Offer Not Found"},
|
||||||
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
logger.warning("Accept Offer: " + str(sys.exc_info()))
|
logger.warning("Accept Offer: " + str(sys.exc_info()))
|
||||||
|
|
||||||
return Response({'action': "Accept Offer", 'message': "Something Went Wrong"},
|
return Response({'action': "Accept Offer", 'message': "Something Went Wrong"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
|
#view for addIssue
|
||||||
|
|
||||||
|
@api_view(['POST'])
|
||||||
|
@isAuthorized(allowed_users=[STUDENT])
|
||||||
|
@precheck(required_data=["Title","Description","opening_id","opening_type"])
|
||||||
|
def addIssue(request, id, email, user_type):
|
||||||
|
try:
|
||||||
|
data = request.data
|
||||||
|
student = get_object_or_404(Student, id=id)
|
||||||
|
issue = Issues()
|
||||||
|
issue.student = student
|
||||||
|
issue.title = data["Title"]
|
||||||
|
issue.description = data["Description"]
|
||||||
|
issue.opening_id = data["opening_id"]
|
||||||
|
issue.opening_type = data["opening_type"]
|
||||||
|
try:
|
||||||
|
if data["opening_type"]==PLACEMENT:
|
||||||
|
opening=get_object_or_404(Placement, id=data["opening_id"])
|
||||||
|
else:
|
||||||
|
opening=get_object_or_404(Internship, id=data["opening_id"])
|
||||||
|
except:
|
||||||
|
return Response({'action': "Add Issue", 'message': "Opening Not Found"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
issue.save()
|
||||||
|
subject=ISSUE_SUBMITTED_TEMPLATE_SUBJECT
|
||||||
|
data={
|
||||||
|
"name":student.name,
|
||||||
|
"application_type":issue.opening_type,
|
||||||
|
"company_name":opening.company_name,
|
||||||
|
"additional_info":{
|
||||||
|
"Abstract":issue.title,
|
||||||
|
"Description":issue.description
|
||||||
|
},
|
||||||
|
"email":email
|
||||||
|
}
|
||||||
|
sendEmail(email, subject, data, STUDENT_ISSUE_SUBMITTED_TEMPLATE)
|
||||||
|
#send_mail_to reps
|
||||||
|
sendEmail(CDC_REPS_EMAILS_FOR_ISSUE,"Issue Raised",data,REPS_ISSUE_SUBMITTED_TEMPLATE)
|
||||||
|
return Response({'action': "Add Issue", 'message': "Issue Added"},
|
||||||
|
status=status.HTTP_200_OK)
|
||||||
|
except Http404:
|
||||||
|
return Response({'action': "Add Issue", 'message': 'Student Not Found'},
|
||||||
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
|
except:
|
||||||
|
logger.warning("Add Issue: " + str(sys.exc_info()))
|
||||||
|
return Response({'action': "Add Issue", 'message': "Something Went Wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
|
@ -1 +0,0 @@
|
||||||
# Create your tests here.
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,195 @@
|
||||||
|
from django.test import TestCase, Client
|
||||||
|
from rest_framework import status
|
||||||
|
from rest_framework.test import APITestCase, APIClient
|
||||||
|
from django.urls import reverse
|
||||||
|
from ..models import *
|
||||||
|
import json
|
||||||
|
from ..utils import generateRandomString
|
||||||
|
import jwt
|
||||||
|
|
||||||
|
# initialize the APIClient app
|
||||||
|
client = APIClient()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class AddNewPlacementTest(APITestCase):
|
||||||
|
""" Test module for adding a new placement """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.valid_payload = {
|
||||||
|
'company_name': 'Test Company 3', 'address': 'Test Address 3', 'company_type': 'Test Company Type 3',
|
||||||
|
'nature_of_business': 'Test Nature of Business 3', 'type_of_organisation': 'Test Type of Organisation 3',
|
||||||
|
'website': 'Test Website 3', 'company_details': 'Test Company Details 3', 'is_company_details_pdf': True,
|
||||||
|
'contact_person_name': 'Test Contact Person Name 3', 'phone_number': 1234567890, 'email': 'test3@test.com',
|
||||||
|
'city': 'Test City 3', 'state': 'Test State 3', 'country': 'Test Country 3', 'pin_code': 123456,
|
||||||
|
'designation': 'Test Designation 3', 'description': 'Test Description 3', 'job_location': 'Test Job Location 3',
|
||||||
|
'is_description_pdf': True, 'compensation_CTC': 300000, 'compensation_gross': 240000,
|
||||||
|
'compensation_take_home': 180000, 'compensation_bonus': 60000, 'is_compensation_details_pdf': True,
|
||||||
|
'allowed_branch': 'Test Allowed Branch 3', 'rs_eligible': True,
|
||||||
|
'selection_procedure_rounds': 'Test Selection Procedure Rounds 3',
|
||||||
|
'selection_procedure_details': 'Test Selection Procedure Details 3',
|
||||||
|
'is_selection_procedure_details_pdf': True, 'tentative_date_of_joining': '2022-03-01',
|
||||||
|
'tentative_no_of_offers': 30, 'other_requirements': 'Test Other Requirements 3'
|
||||||
|
}
|
||||||
|
self.invalid_payload = {
|
||||||
|
'company_name': '', 'address': 'Test Address 4', 'company_type': 'Test Company Type 4',
|
||||||
|
'nature_of_business': 'Test Nature of Business 4', 'type_of_organisation': 'Test Type of Organisation 4',
|
||||||
|
'website': 'Test Website 4', 'company_details': 'Test Company Details 4', 'is_company_details_pdf': True,
|
||||||
|
'contact_person_name': 'Test Contact Person Name 4', 'phone_number': 1234567890, 'email': 'test4@test.com',
|
||||||
|
'city': 'Test City 4', 'state': 'Test State 4', 'country': 'Test Country 4', 'pin_code': 123456,
|
||||||
|
'designation': 'Test Designation 4', 'description': 'Test Description 4', 'job_location': 'Test Job Location 4',
|
||||||
|
'is_description_pdf': True, 'compensation_CTC': 400000, 'compensation_gross': 320000,
|
||||||
|
'compensation_take_home': 240000, 'compensation_bonus': 80000, 'is_compensation_details_pdf': True,
|
||||||
|
'allowed_branch': 'Test Allowed Branch 4', 'rs_eligible': True,
|
||||||
|
'selection_procedure_rounds': 'Test Selection Procedure Rounds 4',
|
||||||
|
'selection_procedure_details': 'Test Selection Procedure Details 4',
|
||||||
|
'is_selection_procedure_details_pdf': True, 'tentative_date_of_joining': '2022-04-01',
|
||||||
|
'tentative_no_of_offers': 40, 'other_requirements': 'Test Other Requirements 4'
|
||||||
|
}
|
||||||
|
self.placement1 = Placement.objects.create(
|
||||||
|
company_name='ABC Corp', compensation_CTC=1000000, tier='1', id=generateRandomString(), allowed_branch=["CSE", "EE"], allowed_batch=["2020"], contact_person_name="test", phone_number=1234567890, email="test1@test.com", offer_accepted=True)
|
||||||
|
self.internship1 = Internship.objects.create(
|
||||||
|
company_name='ABC Corp', stipend=100000, id=generateRandomString(), allowed_branch=["CSE", "EE"], allowed_batch=["2020"], contact_person_name="test", phone_number=1234567890, email="test@gmail.com", offer_accepted=True)
|
||||||
|
self.token_placement1=jwt.encode({'opening_id': self.placement1.id,'opening_type':PLACEMENT,'email':"test1@test.com"}, os.environ.get("EMAIL_VERIFICATION_SECRET_KEY"), algorithm='HS256')
|
||||||
|
|
||||||
|
# def test_create_valid_placement(self):
|
||||||
|
# response = client.post(
|
||||||
|
# reverse('addPlacement'),
|
||||||
|
# data=json.dumps(self.valid_payload),
|
||||||
|
# content_type='application/json'
|
||||||
|
# )
|
||||||
|
# self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||||
|
|
||||||
|
# def test_create_invalid_placement(self):
|
||||||
|
# response = client.post(
|
||||||
|
# reverse('addPlacement'),
|
||||||
|
# data=json.dumps(self.invalid_payload),
|
||||||
|
# content_type='application/json'
|
||||||
|
# )
|
||||||
|
# self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
def test_autofill_jnf_success(self):
|
||||||
|
response = client.get(
|
||||||
|
reverse('Auto FIll JNF'),{"placement_id": self.placement1.id}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data["message"], "Data Found")
|
||||||
|
self.assertEqual(response.data["placement_data"]["company_name"], "ABC Corp")
|
||||||
|
self.assertEqual(response.data["placement_data"]["compensation_CTC"], 1000000)
|
||||||
|
self.assertEqual(response.data["placement_data"]["tier"], "1")
|
||||||
|
self.assertEqual(response.data["placement_data"]["allowed_branch"], ["CSE", "EE"])
|
||||||
|
self.assertEqual(response.data["placement_data"]["allowed_batch"], ["2020"])
|
||||||
|
self.assertEqual(response.data["placement_data"]["contact_person_name"], "test")
|
||||||
|
self.assertEqual(response.data["placement_data"]["phone_number"], 1234567890)
|
||||||
|
self.assertEqual(response.data["placement_data"]["email"], "test1@test.com")
|
||||||
|
|
||||||
|
def test_autofill_jnf_WithInvalidId(self):
|
||||||
|
response = client.get(
|
||||||
|
reverse('Auto FIll JNF'),{"placement_id": generateRandomString()}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data["message"], "Placement Not Found")
|
||||||
|
|
||||||
|
def test_autofill_inf_success(self):
|
||||||
|
response = client.get(
|
||||||
|
reverse('Auto FIll INF'),{"internship_id": self.internship1.id}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data["message"], "Data Found")
|
||||||
|
self.assertEqual(response.data["internship_data"]["company_name"], "ABC Corp")
|
||||||
|
self.assertEqual(response.data["internship_data"]["stipend"], 100000)
|
||||||
|
self.assertEqual(response.data["internship_data"]["allowed_branch"], ["CSE", "EE"])
|
||||||
|
self.assertEqual(response.data["internship_data"]["allowed_batch"], ["2020"])
|
||||||
|
self.assertEqual(response.data["internship_data"]["contact_person_name"], "test")
|
||||||
|
self.assertEqual(response.data["internship_data"]["phone_number"], 1234567890)
|
||||||
|
self.assertEqual(response.data["internship_data"]["email"], "test@gmail.com")
|
||||||
|
|
||||||
|
def test_autofill_inf_WithInvalidId(self):
|
||||||
|
response = client.get(
|
||||||
|
reverse('Auto FIll INF'),{"internship_id": generateRandomString()}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data["message"], "Internship Not Found")
|
||||||
|
|
||||||
|
def test_verify_email_success_placement(self):
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": self.token_placement1}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data["message"], "Email Verified Successfully")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def test_verify_email_WithInvalidEmail_placement(self):
|
||||||
|
token_placement1=jwt.encode({'opening_id': self.placement1.id,'opening_type':PLACEMENT,'email':"hai@hai.com"}, os.environ.get("EMAIL_VERIFICATION_SECRET_KEY"), algorithm='HS256')
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": token_placement1}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data["message"], "Invalid Email")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def test_verify_email_WithInvalidOpeningId_Placement(self):
|
||||||
|
token_placement1=jwt.encode({'opening_id': generateRandomString(),'opening_type':PLACEMENT,'email':"hai@hai.com"}, os.environ.get("EMAIL_VERIFICATION_SECRET_KEY"), algorithm='HS256')
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": token_placement1}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data["message"], "Opening Not Found")
|
||||||
|
|
||||||
|
def test_verify_email_WithInvalidOpeningType(self):
|
||||||
|
token_placement1=jwt.encode({'opening_id': self.placement1.id,'opening_type':"hai",'email':"hai@hai.com"}, os.environ.get("EMAIL_VERIFICATION_SECRET_KEY"), algorithm='HS256')
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": token_placement1}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data["message"], "Invalid opening type")
|
||||||
|
def test_verify_email_WithInvalidToken(self):
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": generateRandomString()}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data["message"], "Something went wrong")
|
||||||
|
def test_verify_email_success_Internship(self):
|
||||||
|
token_placement1=jwt.encode({'opening_id': self.internship1.id,'opening_type':INTERNSHIP,'email':"test@gmail.com"}, os.environ.get("EMAIL_VERIFICATION_SECRET_KEY"), algorithm='HS256')
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": token_placement1}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data["message"], "Email Verified Successfully")
|
||||||
|
|
||||||
|
def test_verify_email_WithInvalidEmail_Internship(self):
|
||||||
|
token_placement1=jwt.encode({'opening_id': self.internship1.id,'opening_type':INTERNSHIP,'email':"hai@hai.com"}, os.environ.get("EMAIL_VERIFICATION_SECRET_KEY"), algorithm='HS256')
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": token_placement1}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data["message"], "Invalid Email")
|
||||||
|
|
||||||
|
def test_verify_email_WithInvalidOpeningId_Internship(self):
|
||||||
|
token_placement1=jwt.encode({'opening_id': generateRandomString(),'opening_type':INTERNSHIP,'email':"hai@hai.com"}, os.environ.get("EMAIL_VERIFICATION_SECRET_KEY"), algorithm='HS256')
|
||||||
|
response = client.post(
|
||||||
|
reverse('Verify Email'),{"token": token_placement1}
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data["message"], "Opening Not Found")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
# 1.Write Tests For AddPlacement Functions All cases #
|
||||||
|
# #
|
||||||
|
# 2.Write Tests For AddInternship Function All cases #
|
||||||
|
# #
|
||||||
|
################################################################
|
||||||
|
def test_addPlacement_sucess(self):
|
||||||
|
self.assertTrue(True)
|
||||||
|
|
||||||
|
def test_addPlacement_failure(self):
|
||||||
|
self.assertTrue(True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,835 @@
|
||||||
|
# Create your tests here.
|
||||||
|
from ..models import *
|
||||||
|
from ..serializers import *
|
||||||
|
from django.test import TestCase, Client
|
||||||
|
from rest_framework import status
|
||||||
|
from rest_framework.test import APITestCase, APIClient
|
||||||
|
from django.urls import reverse
|
||||||
|
from ..utils import *
|
||||||
|
import json
|
||||||
|
from django.utils import timezone
|
||||||
|
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||||
|
|
||||||
|
|
||||||
|
class StudentViewsTestCase(APITestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.client = APIClient()
|
||||||
|
self.user = User.objects.create(
|
||||||
|
email=str(os.environ.get("EMAIL_ID")),
|
||||||
|
id=str(os.environ.get("ROLL_NO")),
|
||||||
|
user_type=[STUDENT])
|
||||||
|
self.assertEqual(
|
||||||
|
self.user.email, User.objects.get(id=self.user.id).email)
|
||||||
|
self.student = Student.objects.create(
|
||||||
|
name="Test Student", id=self.user.id, resumes=["8BSLybntULgrPPm_beehyv.pdf"], roll_no=str(os.environ.get("ROLL_NO")), branch="CSE", batch="2020", phone_number=1234567890, changed_by=self.user, can_apply=True,
|
||||||
|
can_apply_internship=True, degree="bTech", cpi=7.95,
|
||||||
|
)
|
||||||
|
self.assertEqual(self.student.name,
|
||||||
|
Student.objects.get(id=self.student.id).name)
|
||||||
|
self.internship = Internship.objects.create(
|
||||||
|
company_name="Test Company", id=generateRandomString(), website="https://testwebsite.com", address="Test Address", company_type="Test Company Type", offer_accepted=True, season=["Summer"], allowed_branch=["CSE"],
|
||||||
|
allowed_batch=["2020"], contact_person_name="Test Contact Person", phone_number="1234567890", email="test@test.com", email_verified=True, stipend=10000,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.placement = Placement.objects.create(
|
||||||
|
company_name="Test Company", id=generateRandomString(), website="https://testwebsite.com", address="Test Address", company_type="Test Company Type", offer_accepted=True, tier="6", allowed_branch=["CSE"], allowed_batch=["2020"],
|
||||||
|
contact_person_name="Test Contact Person", phone_number="1234567890", email="test@test.com", email_verified=True,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(self.placement.company_name, Placement.objects.get(
|
||||||
|
id=self.placement.id).company_name)
|
||||||
|
|
||||||
|
self.internship_application = InternshipApplication.objects.create(
|
||||||
|
id=generateRandomString(), internship=self.internship, student=self.student, resume="8BSLybntULgrPPm_beehyv.pdf", selected=True
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(self.internship_application.internship.company_name, InternshipApplication.objects.get(
|
||||||
|
id=self.internship_application.id).internship.company_name)
|
||||||
|
self.placement_application = PlacementApplication.objects.create(
|
||||||
|
id=generateRandomString(), placement=self.placement, student=self.student, resume="8BSLybntULgrPPm_beehyv.pdf", selected=True
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(self.placement_application.placement.company_name, PlacementApplication.objects.get(
|
||||||
|
id=self.placement_application.id).placement.company_name)
|
||||||
|
self.issue = Issues.objects.create(
|
||||||
|
student=self.student, title="Test Issue", description="Test Issue Description", opening_id=self.internship.id,
|
||||||
|
opening_type=INTERNSHIP
|
||||||
|
)
|
||||||
|
|
||||||
|
# get token from google OAuth API
|
||||||
|
response = self.client.post(reverse('Refresh Token'), {
|
||||||
|
'refresh_token': os.environ.get("REFRESH_TOKEN")}, format='json')
|
||||||
|
self.student_token = response.data['id_token']
|
||||||
|
|
||||||
|
def test_student_accept_offer_internship(self):
|
||||||
|
url = reverse('Student Accept Offer')
|
||||||
|
data = {
|
||||||
|
'opening_id': self.internship.id,
|
||||||
|
'offer_accepted': True,
|
||||||
|
'opening_type': INTERNSHIP
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Updated Offer Status')
|
||||||
|
self.assertEqual(InternshipApplication.objects.get(
|
||||||
|
id=self.internship_application.id).offer_accepted, True)
|
||||||
|
|
||||||
|
def test_student_accept_offer_internship_notFound(self):
|
||||||
|
url = reverse('Student Accept Offer')
|
||||||
|
data = {
|
||||||
|
'opening_id': self.internship.id,
|
||||||
|
'offer_accepted': True,
|
||||||
|
'opening_type': INTERNSHIP
|
||||||
|
}
|
||||||
|
self.internship_application.selected = False
|
||||||
|
self.internship_application.offer_accepted = False
|
||||||
|
self.internship_application.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'], 'Offer Not Found')
|
||||||
|
self.assertEqual(InternshipApplication.objects.get(
|
||||||
|
id=self.internship_application.id).offer_accepted, False)
|
||||||
|
|
||||||
|
def test_delete_application_internship(self):
|
||||||
|
url = reverse('Delete Application')
|
||||||
|
data = {
|
||||||
|
'application_id': self.internship_application.id,
|
||||||
|
'opening_type': INTERNSHIP
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Application Deleted')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
id=self.internship_application.id).count(), 0)
|
||||||
|
|
||||||
|
def test_delete_application_internship_deadlinePassed(self):
|
||||||
|
url = reverse('Delete Application')
|
||||||
|
data = {
|
||||||
|
'application_id': self.internship_application.id,
|
||||||
|
'opening_type': INTERNSHIP
|
||||||
|
}
|
||||||
|
self.internship.deadline_datetime = timezone.now().replace(
|
||||||
|
hour=0, minute=0, second=0, microsecond=0)
|
||||||
|
self.internship.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'], 'Deadline Passed')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
id=self.internship_application.id).count(), 1)
|
||||||
|
|
||||||
|
def test_delete_application_internship_notFound(self):
|
||||||
|
url = reverse('Delete Application')
|
||||||
|
data = {
|
||||||
|
'application_id': self.internship_application.id,
|
||||||
|
'opening_type': INTERNSHIP
|
||||||
|
}
|
||||||
|
self.internship_application.delete()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code,
|
||||||
|
status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(
|
||||||
|
response.data['message'], 'No InternshipApplication matches the given query.')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
id=self.internship_application.id).count(), 0)
|
||||||
|
|
||||||
|
# def test_add_application_internship(self):
|
||||||
|
# url = reverse('Delete Application')
|
||||||
|
# data = {
|
||||||
|
# 'application_id': self.internship_application.id,
|
||||||
|
# 'opening_type': INTERNSHIP
|
||||||
|
# }
|
||||||
|
# self.client.credentials(
|
||||||
|
# HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
# response = self.client.post(url, data, format='json')
|
||||||
|
# self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
# self.assertEqual(response.data['message'], 'Application Deleted')
|
||||||
|
# self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
# id=self.internship_application.id).count(), 0)
|
||||||
|
# # deleted existing application
|
||||||
|
# url = reverse('Add Application')
|
||||||
|
# data = {
|
||||||
|
# OPENING_ID: self.internship.id,
|
||||||
|
# OPENING_TYPE: INTERNSHIP,
|
||||||
|
# RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
# ADDITIONAL_INFO: []
|
||||||
|
# }
|
||||||
|
# self.client.credentials(
|
||||||
|
# HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
# response = self.client.post(url, data, format='json')
|
||||||
|
# self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
# self.assertEqual(response.data['message'], 'Application Submitted')
|
||||||
|
# self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
# student=self.student).count(), 1)
|
||||||
|
# self.internship_application = InternshipApplication.objects.filter(
|
||||||
|
# student=self.student)
|
||||||
|
# # self.internship.deadline_datetime = timezone.now().replace(
|
||||||
|
# # hour=0, minute=0, second=0, microsecond=0)
|
||||||
|
# # self.internship.save()
|
||||||
|
|
||||||
|
# response = self.client.post(url, data, format='json')
|
||||||
|
# self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
# self.assertEqual(response.data['message'],
|
||||||
|
# 'Application is already Submitted')
|
||||||
|
# self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
# student=self.student).count(), 1)
|
||||||
|
# self.internship_application.delete()
|
||||||
|
# data[OPENING_ID] = generateRandomString()
|
||||||
|
# response = self.client.post(url, data, format='json')
|
||||||
|
# self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
# self.assertEqual(response.data['message'],
|
||||||
|
# 'No Internship matches the given query.')
|
||||||
|
# self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
# student=self.student).count(), 0)
|
||||||
|
|
||||||
|
def test_student_accept_offer_placement(self):
|
||||||
|
url = reverse('Student Accept Offer')
|
||||||
|
data = {
|
||||||
|
'opening_id': self.placement.id,
|
||||||
|
'offer_accepted': True,
|
||||||
|
'opening_type': PLACEMENT
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Updated Offer Status')
|
||||||
|
self.assertEqual(PlacementApplication.objects.get(
|
||||||
|
id=self.placement_application.id).offer_accepted, True)
|
||||||
|
|
||||||
|
def test_student_accept_offer_placement_offerNotFound(self):
|
||||||
|
url = reverse('Student Accept Offer')
|
||||||
|
data = {
|
||||||
|
'opening_id': self.placement.id,
|
||||||
|
'offer_accepted': True,
|
||||||
|
'opening_type': PLACEMENT
|
||||||
|
}
|
||||||
|
self.placement_application.selected = False
|
||||||
|
self.placement_application.offer_accepted = False
|
||||||
|
self.placement_application.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code,
|
||||||
|
status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'], 'Offer Not Found')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
id=self.placement_application.id, selected=True).count(), 0)
|
||||||
|
self.assertEqual(PlacementApplication.objects.get(
|
||||||
|
id=self.placement_application.id).offer_accepted, False)
|
||||||
|
|
||||||
|
def test_delete_application_placement(self):
|
||||||
|
url = reverse('Delete Application')
|
||||||
|
data = {
|
||||||
|
'application_id': self.placement_application.id,
|
||||||
|
'opening_type': PLACEMENT
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Application Deleted')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
id=self.placement_application.id).count(), 0)
|
||||||
|
|
||||||
|
def test_delete_application_placement_notFound(self):
|
||||||
|
url = reverse('Delete Application')
|
||||||
|
data = {
|
||||||
|
'application_id': self.placement_application.id,
|
||||||
|
'opening_type': PLACEMENT
|
||||||
|
}
|
||||||
|
self.placement_application.delete()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code,
|
||||||
|
status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(
|
||||||
|
response.data['message'], 'No PlacementApplication matches the given query.')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
id=self.placement_application.id).count(), 0)
|
||||||
|
|
||||||
|
def test_delete_application_placement_deadlinePassed(self):
|
||||||
|
url = reverse('Delete Application')
|
||||||
|
data = {
|
||||||
|
'application_id': self.placement_application.id,
|
||||||
|
'opening_type': PLACEMENT
|
||||||
|
}
|
||||||
|
self.placement.deadline_datetime = timezone.now().replace(
|
||||||
|
hour=0, minute=0, second=0, microsecond=0)
|
||||||
|
self.placement.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code,
|
||||||
|
status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'], 'Deadline Passed')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
id=self.placement_application.id).count(), 1)
|
||||||
|
|
||||||
|
def test_add_application_placement(self):
|
||||||
|
self.placement.additional_info = ["Test"]
|
||||||
|
self.placement_application.delete()
|
||||||
|
# deleted existing application
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: [{"Test": "Test"}]
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Application Submitted')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student).count(), 1)
|
||||||
|
|
||||||
|
def test_add_application_placement_deadlinePassed(self):
|
||||||
|
self.placement.deadline_datetime = timezone.now().replace(
|
||||||
|
hour=0, minute=0, second=0, microsecond=0)
|
||||||
|
self.placement.save()
|
||||||
|
# deleted existing application
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'No Placement matches the given query.')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_placement_alreadyApplied(self):
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'Application is already Submitted')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 1)
|
||||||
|
|
||||||
|
def test_add_application_placement_notFound(self):
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
|
||||||
|
data[OPENING_ID] = generateRandomString()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'No Placement matches the given query.')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_placement_notApproved(self):
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.placement.offer_accepted = False
|
||||||
|
self.placement.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'Placement Not Approved')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_placement_notEmailVerified(self):
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.placement.email_verified = False
|
||||||
|
self.placement.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'Placement Not Approved')
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_placement_notRegistered(self):
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.student.can_apply = False
|
||||||
|
self.student.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"Student Can't Apply")
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_placement_InvalidOpeningtype(self):
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: "Invalid",
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"Something Went Wrong")
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_placement_InvalidResume(self):
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: 'Invalid',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"resume_file_name Not Found")
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_placement_MissingAdditionalInfo(self):
|
||||||
|
self.placement_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
self.placement.additional_info = ["Test"]
|
||||||
|
self.placement.save()
|
||||||
|
data = {
|
||||||
|
|
||||||
|
OPENING_ID: self.placement.id,
|
||||||
|
OPENING_TYPE: PLACEMENT,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"Something Went Wrong")
|
||||||
|
self.assertEqual(PlacementApplication.objects.filter(
|
||||||
|
student=self.student, placement=self.placement).count(), 0)
|
||||||
|
|
||||||
|
def test_getdashboard(self):
|
||||||
|
url = reverse('Dashboard')
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.get(url, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Data Found')
|
||||||
|
internships = Internship.objects.filter(allowed_batch__contains=[self.student.batch],
|
||||||
|
allowed_branch__contains=[
|
||||||
|
self.student.branch],
|
||||||
|
deadline_datetime__gte=datetime.datetime.now(),
|
||||||
|
offer_accepted=True, email_verified=True)
|
||||||
|
placements = Placement.objects.filter(allowed_batch__contains=[self.student.batch],
|
||||||
|
allowed_branch__contains=[
|
||||||
|
self.student.branch],
|
||||||
|
deadline_datetime__gte=datetime.datetime.now(),
|
||||||
|
offer_accepted=True, email_verified=True)
|
||||||
|
|
||||||
|
filtered_internships = internship_eligibility_filters(
|
||||||
|
self.student, internships)
|
||||||
|
filtered_placements = placement_eligibility_filters(
|
||||||
|
self.student, placements)
|
||||||
|
self.assertEqual(
|
||||||
|
len(response.data['internships']), len(filtered_internships))
|
||||||
|
self.assertEqual(
|
||||||
|
len(response.data['placements']), len(filtered_placements))
|
||||||
|
self.assertEqual(len(response.data['placementApplication']), 1)
|
||||||
|
self.assertEqual(len(response.data['internshipApplication']), 1)
|
||||||
|
self.assertEqual(response.data['placementApplication'][0]
|
||||||
|
['placement']['company_name'], self.placement.company_name)
|
||||||
|
self.assertEqual(response.data['internshipApplication'][0]
|
||||||
|
['internship']['company_name'], self.internship.company_name)
|
||||||
|
|
||||||
|
# def test_get_contributor_stats(self):
|
||||||
|
# url = reverse('get_contributor_stats', kwargs={'id': self.student.id})
|
||||||
|
# self.client.credentials(HTTP_AUTHORIZATION='Bearer ' + self.contributor_token)
|
||||||
|
# response = self.client.get(url, format='json')
|
||||||
|
# self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
# self.assertEqual(response.data['message'], 'Contributor Stats Fetched')
|
||||||
|
# self.assertEqual(len(response.data['data']), 1)
|
||||||
|
# self.assertEqual(response.data['data'][0]['name'], self.contributor.name)
|
||||||
|
# self.assertEqual(response.data['data'][0]['email'], self.contributor.email)
|
||||||
|
# self.assertEqual(response.data['data'][0]['contribution_count'], self.contributor.contribution_count)
|
||||||
|
|
||||||
|
def test_add_issue(self):
|
||||||
|
url = reverse('Add Issue')
|
||||||
|
data = {
|
||||||
|
'Title': 'Test Issue 2',
|
||||||
|
'Description': 'Test Issue Description 2',
|
||||||
|
'opening_id': self.placement.id,
|
||||||
|
'opening_type': PLACEMENT
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Issue Added')
|
||||||
|
self.assertEqual(Issues.objects.filter(
|
||||||
|
student=self.student).count(), 2)
|
||||||
|
self.assertEqual(Issues.objects.filter(
|
||||||
|
opening_id=self.placement.id).count(), 1)
|
||||||
|
self.assertEqual(Issues.objects.filter(
|
||||||
|
opening_type=PLACEMENT).count(), 1)
|
||||||
|
|
||||||
|
def test_add_application_internship(self):
|
||||||
|
self.internship.additional_info = ["Test"]
|
||||||
|
self.internship_application.delete()
|
||||||
|
# deleted existing application
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: [{"Test": "Test"}]
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Application Submitted')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student).count(), 1)
|
||||||
|
|
||||||
|
def test_add_application_internship_deadlinePassed(self):
|
||||||
|
self.internship.deadline_datetime = timezone.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||||
|
self.internship.save()
|
||||||
|
# deleted existing application
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'No Internship matches the given query.')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_internship_alreadyApplied(self):
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'Application is already Submitted')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 1)
|
||||||
|
|
||||||
|
def test_add_application_internship_notFound(self):
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
|
||||||
|
data[OPENING_ID] = generateRandomString()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'No Internship matches the given query.')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_internship_notApproved(self):
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.internship.offer_accepted = False
|
||||||
|
self.internship.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'Internship Not Approved')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_internship_notEmailVerified(self):
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.internship.email_verified = False
|
||||||
|
self.internship.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'Internship Not Approved')
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_internship_notRegistered(self):
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.student.can_apply_internship = False
|
||||||
|
self.student.save()
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"Student Can't Apply")
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_internship_InvalidOpeningtype(self):
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: "Invalid",
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"Something Went Wrong")
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_internship_InvalidResume(self):
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
data = {
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: 'Invalid',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"resume_file_name Not Found")
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 0)
|
||||||
|
|
||||||
|
def test_add_application_internship_MissingAdditionalInfo(self):
|
||||||
|
self.internship_application.delete()
|
||||||
|
url = reverse('Add Application')
|
||||||
|
self.internship.additional_info = ["Test"]
|
||||||
|
self.internship.save()
|
||||||
|
data = {
|
||||||
|
|
||||||
|
OPENING_ID: self.internship.id,
|
||||||
|
OPENING_TYPE: INTERNSHIP,
|
||||||
|
RESUME_FILE_NAME: '8BSLybntULgrPPm_beehyv.pdf',
|
||||||
|
ADDITIONAL_INFO: []
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
"Something Went Wrong")
|
||||||
|
self.assertEqual(InternshipApplication.objects.filter(
|
||||||
|
student=self.student, internship=self.internship).count(), 0)
|
||||||
|
|
||||||
|
def test_getStudentProfile(self):
|
||||||
|
url = reverse('Student Profile')
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.get(url, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Details Found')
|
||||||
|
self.assertEqual(response.data['details']['id'], self.student.id)
|
||||||
|
self.assertEqual(response.data['details']['roll_no'],
|
||||||
|
self.student.roll_no)
|
||||||
|
self.assertEqual(response.data['details']['name'], self.student.name)
|
||||||
|
self.assertEqual(response.data['details']['batch'], self.student.batch)
|
||||||
|
self.assertEqual(response.data['details']['branch'],
|
||||||
|
self.student.branch)
|
||||||
|
self.assertEqual(response.data['details']['phone_number'],
|
||||||
|
self.student.phone_number)
|
||||||
|
self.assertEqual(response.data['details']
|
||||||
|
['cpi'], str(self.student.cpi))
|
||||||
|
for i in range(len(response.data['details']['resume_list'])):
|
||||||
|
self.assertIn(
|
||||||
|
response.data['details']['resume_list'][i]['name'], self.student.resumes)
|
||||||
|
for i in range(len(response.data['details']['offers'])):
|
||||||
|
self.assertIn(response.data['details']['offers'][i]
|
||||||
|
['application_id'], self.placement_application.id)
|
||||||
|
|
||||||
|
def test_addResume_success(self):
|
||||||
|
pdf = SimpleUploadedFile(
|
||||||
|
'kalera.pdf', b'content', content_type='application/pdf')
|
||||||
|
url = reverse('Upload Resume')
|
||||||
|
files = {'file': pdf}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, files, format='multipart')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Resume Added')
|
||||||
|
|
||||||
|
def test_add_resume_max_limit_reached(self):
|
||||||
|
pdf = SimpleUploadedFile(
|
||||||
|
'kalera.pdf', b'content', content_type='application/pdf')
|
||||||
|
url = reverse('Upload Resume')
|
||||||
|
files = {'file': pdf}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
self.student.resumes = ['resume1.pdf', 'resume2.pdf', 'resume3.pdf']
|
||||||
|
self.student.save()
|
||||||
|
response = self.client.post(url, files, format='multipart')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
self.assertEqual(response.data, {
|
||||||
|
'action': 'Upload Resume', 'message': 'Max Number of Resumes limit reached'})
|
||||||
|
self.student.refresh_from_db()
|
||||||
|
self.assertEqual(len(self.student.resumes), 3)
|
||||||
|
|
||||||
|
def test_deleteResume_success(self):
|
||||||
|
destination_path = STORAGE_DESTINATION_RESUMES + \
|
||||||
|
self.student.id+'/'+"8BSLybntULgrPPm_beehyv.pdf"
|
||||||
|
# check it whats this above without this test giving error
|
||||||
|
with open(destination_path, 'w') as f:
|
||||||
|
f.write('test')
|
||||||
|
f.close()
|
||||||
|
# create a file here
|
||||||
|
|
||||||
|
url = reverse('Delete Resume')
|
||||||
|
data = {
|
||||||
|
'resume_file_name': '8BSLybntULgrPPm_beehyv.pdf'
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
self.assertEqual(response.data['message'], 'Resume Deleted')
|
||||||
|
self.student.refresh_from_db()
|
||||||
|
self.assertEqual(self.student.resumes, [])
|
||||||
|
remove(destination_path)
|
||||||
|
|
||||||
|
def test_deleteResume_invalidResume(self):
|
||||||
|
url = reverse('Delete Resume')
|
||||||
|
data = {
|
||||||
|
'resume_file_name': 'Invalid'
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'],
|
||||||
|
'Resume Not Found')
|
||||||
|
self.student.refresh_from_db()
|
||||||
|
self.assertEqual(self.student.resumes, ['8BSLybntULgrPPm_beehyv.pdf'])
|
||||||
|
|
||||||
|
def test_deleteResume_missingResumeinStorage(self):
|
||||||
|
url = reverse('Delete Resume')
|
||||||
|
data = {
|
||||||
|
'resume_file_name': '8BSLybntULgrPPm_beehyv.pdf'
|
||||||
|
}
|
||||||
|
self.client.credentials(
|
||||||
|
HTTP_AUTHORIZATION='Bearer ' + self.student_token)
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||||
|
self.assertEqual(response.data['message'], 'File Not Found')
|
|
@ -8,5 +8,4 @@ urlpatterns = [
|
||||||
path('student/', include(studentUrls)),
|
path('student/', include(studentUrls)),
|
||||||
path('company/', include(companyUrls)),
|
path('company/', include(companyUrls)),
|
||||||
path('admin/', include(adminUrls)),
|
path('admin/', include(adminUrls)),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -28,7 +28,7 @@ from rest_framework import status
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
|
||||||
from .constants import *
|
from .constants import *
|
||||||
from .models import User, PrePlacementOffer, PlacementApplication, Placement, Student, Internship
|
from .models import User, PrePlacementOffer, PlacementApplication, Placement, Student, Internship,InternshipApplication
|
||||||
|
|
||||||
logger = logging.getLogger('db')
|
logger = logging.getLogger('db')
|
||||||
|
|
||||||
|
@ -81,22 +81,22 @@ def precheck(required_data=None):
|
||||||
request_data = request.data
|
request_data = request.data
|
||||||
if not len(request_data):
|
if not len(request_data):
|
||||||
request_data = request.POST
|
request_data = request.POST
|
||||||
if len(request_data):
|
|
||||||
|
if request_data and len(request_data):
|
||||||
for i in required_data:
|
for i in required_data:
|
||||||
# print(i)
|
|
||||||
if i not in request_data:
|
if i not in request_data:
|
||||||
return Response({'action': "Pre check", 'message': str(i) + " Not Found"},
|
return Response({'action': "Pre check", 'message': str(i) + " Not Found"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
else:
|
else:
|
||||||
return Response({'action': "Pre check", 'message': "Message Data not Found"},
|
return Response({'action': "Pre check", 'message': "Message Data not Found"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
# print("Pre check: " + str(request_data))
|
|
||||||
return view_func(request, *args, **kwargs)
|
return view_func(request, *args, **kwargs)
|
||||||
except:
|
|
||||||
# print what exception is
|
except Exception as e:
|
||||||
print(traceback.format_exc())
|
# Log the full traceback for debugging purposes
|
||||||
logger.warning("Pre check: " + str(sys.exc_info()))
|
logger.error("Pre check error: %s", traceback.format_exc())
|
||||||
return Response({'action': "Pre check", 'message': "Something went wrong"},
|
return Response({'action': "Pre check", 'message': "Something went wrong: " + str(e)},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
return wrapper_func
|
return wrapper_func
|
||||||
|
@ -151,6 +151,26 @@ def isAuthorized(allowed_users=None):
|
||||||
|
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
def isAuthorizedService():
|
||||||
|
def decorator(view_func):
|
||||||
|
def wrapper_func(request, *args, **kwargs):
|
||||||
|
try:
|
||||||
|
headers = request.META
|
||||||
|
if 'HTTP_AUTHORIZATION' in headers:
|
||||||
|
token_id = headers['HTTP_AUTHORIZATION'][7:]
|
||||||
|
jwt.decode(token_id, os.environ.get("JWT_SECRET_KEY"), algorithms="HS256")
|
||||||
|
return view_func(request, *args, **kwargs)
|
||||||
|
else:
|
||||||
|
raise PermissionError("Authorization Header Not Found")
|
||||||
|
except:
|
||||||
|
logger.warning("Is Authorized? " + str(sys.exc_info()))
|
||||||
|
return Response(
|
||||||
|
{'action': "Is Authorized?", 'message': "Something went wrong. Contact CDC for more details"},
|
||||||
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
return wrapper_func
|
||||||
|
|
||||||
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
def generateRandomString():
|
def generateRandomString():
|
||||||
try:
|
try:
|
||||||
|
@ -194,14 +214,16 @@ def sendEmail(email_to, subject, data, template, attachment_jnf_response=None):
|
||||||
else:
|
else:
|
||||||
recipient_list = [str(email_to), ]
|
recipient_list = [str(email_to), ]
|
||||||
|
|
||||||
msg = EmailMultiAlternatives(subject, text_content, email_from, recipient_list)
|
#batch 100 ppl to send as bcc
|
||||||
msg.attach_alternative(html_content, "text/html")
|
for i in range(0,len(recipient_list),100):
|
||||||
if attachment_jnf_response:
|
msg = EmailMultiAlternatives(subject, text_content, email_from,None,bcc=recipient_list[i:i+100])
|
||||||
# logger.info(attachment_jnf_response)
|
msg.attach_alternative(html_content, "text/html")
|
||||||
pdf = pdfkit.from_string(attachment_jnf_response['html'], False,
|
if attachment_jnf_response:
|
||||||
options={"--enable-local-file-access": "", '--dpi': '96'})
|
# logger.info(attachment_jnf_response)
|
||||||
msg.attach(attachment_jnf_response['name'], pdf, 'application/pdf')
|
pdf = pdfkit.from_string(attachment_jnf_response['html'], False,
|
||||||
msg.send()
|
options={"--enable-local-file-access": "", '--dpi': '96'})
|
||||||
|
msg.attach(attachment_jnf_response['name'], pdf, 'application/pdf')
|
||||||
|
msg.send()
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
logger.error("Send Email: " + str(sys.exc_info()))
|
logger.error("Send Email: " + str(sys.exc_info()))
|
||||||
|
@ -216,27 +238,38 @@ def PlacementApplicationConditions(student, placement):
|
||||||
PPO_PSU = [i for i in PPO if i.tier == 'psu']
|
PPO_PSU = [i for i in PPO if i.tier == 'psu']
|
||||||
# find length of PPO
|
# find length of PPO
|
||||||
if len(selected_companies) + len(PPO) >= MAX_OFFERS_PER_STUDENT:
|
if len(selected_companies) + len(PPO) >= MAX_OFFERS_PER_STUDENT:
|
||||||
raise PermissionError("Max Applications Reached for the Season")
|
raise PermissionError("Max Applications Reached for the Season1")
|
||||||
|
|
||||||
if len(selected_companies_PSU) > 0:
|
if len(selected_companies_PSU) > 0:
|
||||||
raise PermissionError('Selected for PSU Can\'t apply anymore')
|
raise PermissionError('Selected for PSU Can\'t apply anymore2')
|
||||||
|
|
||||||
if len(PPO_PSU) > 0:
|
if len(PPO_PSU) > 0:
|
||||||
raise PermissionError('Selected for PSU Can\'t apply anymore')
|
raise PermissionError('Selected for PSU Can\'t apply anymore3')
|
||||||
|
|
||||||
if placement.tier == 'psu':
|
if placement.tier == 'psu':
|
||||||
return True, "Conditions Satisfied"
|
return True, "Conditions Satisfied"
|
||||||
|
|
||||||
for i in selected_companies:
|
for i in selected_companies:
|
||||||
if int(i.placement.tier) < int(placement.tier):
|
if 1.5 * i.placement.compensation_CTC > placement.compensation_CTC:
|
||||||
return False, "Can't apply for this tier"
|
return False, "Can't apply for this Placement, 1.5 times CTC condition not satisfied"
|
||||||
|
|
||||||
for i in PPO:
|
for i in PPO:
|
||||||
if int(i.tier) < int(placement.tier):
|
if 1.5 * i.compensation > placement.compensation_CTC:
|
||||||
return False, "Can't apply for this tier"
|
return False, "Can't apply for this Placement, 1.5 times CTC condition not satisfied"
|
||||||
|
if student.degree not in placement.eligiblestudents:
|
||||||
if student.degree != 'bTech' and not placement.rs_eligible:
|
raise PermissionError("Can't apply for this placement4")
|
||||||
raise PermissionError("Can't apply for this placement")
|
if student.degree == bTech and student.batch not in placement.allowed_batch:
|
||||||
|
raise PermissionError("Can't apply for this placement5")
|
||||||
|
if student.branch not in placement.allowed_branch:
|
||||||
|
raise PermissionError("Can't apply for this placement6")
|
||||||
|
if student.can_apply == False:
|
||||||
|
raise PermissionError("Can't apply for this placement7")
|
||||||
|
if student.isBacklog == True and placement.backlog_eligible == False:
|
||||||
|
raise PermissionError("Can't apply for this placement8")
|
||||||
|
if student.isPwd == True and placement.pwd_eligible == False:
|
||||||
|
raise PermissionError("Can't apply for this placement9")
|
||||||
|
if placement.cpi_eligible > student.cpi:
|
||||||
|
raise PermissionError("Can't apply for this placement10")
|
||||||
|
|
||||||
return True, "Conditions Satisfied"
|
return True, "Conditions Satisfied"
|
||||||
|
|
||||||
|
@ -246,6 +279,34 @@ def PlacementApplicationConditions(student, placement):
|
||||||
logger.warning("Utils - PlacementApplicationConditions: " + str(sys.exc_info()))
|
logger.warning("Utils - PlacementApplicationConditions: " + str(sys.exc_info()))
|
||||||
return False, "_"
|
return False, "_"
|
||||||
|
|
||||||
|
def InternshipApplicationConditions(student, internship):
|
||||||
|
try:
|
||||||
|
selected_companies = InternshipApplication.objects.filter(student=student, selected=True)
|
||||||
|
if len(selected_companies) >= 1:
|
||||||
|
return False, "You have already secured a Internship"
|
||||||
|
if student.degree not in internship.eligiblestudents:
|
||||||
|
raise PermissionError("Can't apply for this Internship")
|
||||||
|
if student.degree != 'BSMS' and student.branch not in internship.allowed_branch: # for BSMS branch is not considered
|
||||||
|
raise PermissionError("Can't apply for this Internship")
|
||||||
|
if student.degree == bTech and student.batch not in internship.allowed_batch:
|
||||||
|
raise PermissionError("Can't apply for this Internship")
|
||||||
|
if student.can_apply_internship == False:
|
||||||
|
raise PermissionError("Can't apply for this Internship")
|
||||||
|
if student.isBacklog == True and internship.backlog_eligible == False:
|
||||||
|
raise PermissionError("Can't apply for this Internship")
|
||||||
|
if student.isPwd == True and internship.pwd_eligible == False:
|
||||||
|
raise PermissionError("Can't apply for this Internship")
|
||||||
|
if internship.cpi_eligible > student.cpi:
|
||||||
|
raise PermissionError("Can't apply for this Internship")
|
||||||
|
|
||||||
|
return True, "Conditions Satisfied"
|
||||||
|
|
||||||
|
except PermissionError as e:
|
||||||
|
return False, e
|
||||||
|
except:
|
||||||
|
logger.warning("Utils - InternshipApplicationConditions: " + str(sys.exc_info()))
|
||||||
|
return False, "_"
|
||||||
|
|
||||||
|
|
||||||
def getTier(compensation_gross, is_psu=False):
|
def getTier(compensation_gross, is_psu=False):
|
||||||
try:
|
try:
|
||||||
|
@ -253,6 +314,8 @@ def getTier(compensation_gross, is_psu=False):
|
||||||
return True, 'psu'
|
return True, 'psu'
|
||||||
if compensation_gross < 0:
|
if compensation_gross < 0:
|
||||||
raise ValueError("Negative Compensation")
|
raise ValueError("Negative Compensation")
|
||||||
|
elif compensation_gross < 450000: # Open Tier If less than 450,000
|
||||||
|
return True, "8"
|
||||||
elif compensation_gross < 600000: # Tier 7 If less than 600,000
|
elif compensation_gross < 600000: # Tier 7 If less than 600,000
|
||||||
return True, "7"
|
return True, "7"
|
||||||
# Tier 6 If less than 800,000 and greater than or equal to 600,000
|
# Tier 6 If less than 800,000 and greater than or equal to 600,000
|
||||||
|
@ -368,49 +431,109 @@ def placement_eligibility_filters(student, placements):
|
||||||
except:
|
except:
|
||||||
logger.warning("Utils - placement_eligibility_filters: " + str(sys.exc_info()))
|
logger.warning("Utils - placement_eligibility_filters: " + str(sys.exc_info()))
|
||||||
return placements
|
return placements
|
||||||
|
|
||||||
|
|
||||||
|
def internship_eligibility_filters(student, internships):
|
||||||
|
try:
|
||||||
|
filtered_internships = []
|
||||||
|
for internship in internships.iterator():
|
||||||
|
|
||||||
|
if InternshipApplicationConditions(student, internship)[0]:
|
||||||
|
filtered_internships.append(internship)
|
||||||
|
|
||||||
|
return filtered_internships
|
||||||
|
except:
|
||||||
|
logger.warning("Utils - internship_eligibility_filters: " + str(sys.exc_info()))
|
||||||
|
return internships
|
||||||
|
|
||||||
|
|
||||||
@background_task.background(schedule=2)
|
@background_task.background(schedule=2)
|
||||||
def send_opening_notifications(placement_id):
|
def send_opening_notifications(opening_id, opening_type=PLACEMENT):
|
||||||
try:
|
try:
|
||||||
placement = get_object_or_404(Placement, id=placement_id)
|
if opening_type == PLACEMENT:
|
||||||
|
opening = get_object_or_404(Placement, id=opening_id)
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Internship, id=opening_id)
|
||||||
|
emails=[]
|
||||||
students = Student.objects.all()
|
students = Student.objects.all()
|
||||||
for student in students.iterator():
|
for student in students.iterator():
|
||||||
if student.branch in placement.allowed_branch:
|
if student.branch in opening.allowed_branch:
|
||||||
if student.degree == 'bTech' or placement.rs_eligible is True:
|
if student.degree == 'bTech' or opening.rs_eligible is True:
|
||||||
if PlacementApplicationConditions(student, placement)[0]:
|
if (isinstance(opening,Placement) and PlacementApplicationConditions(student, opening)[0]) or (isinstance(opening,Internship) and InternshipApplicationConditions(student, opening)[0]):
|
||||||
try:
|
try:
|
||||||
student_user = get_object_or_404(User, id=student.id)
|
student_user = get_object_or_404(User, id=student.id)
|
||||||
subject = NOTIFY_STUDENTS_OPENING_TEMPLATE_SUBJECT.format(
|
emails.append(student_user.email)
|
||||||
company_name=placement.company_name)
|
#sendEmail(student_user.email, subject, data, NOTIFY_STUDENTS_OPENING_TEMPLATE)
|
||||||
deadline_datetime = placement.deadline_datetime.astimezone(pytz.timezone('Asia/Kolkata'))
|
|
||||||
data = {
|
|
||||||
"company_name": placement.company_name,
|
|
||||||
"opening_type": 'Placement',
|
|
||||||
"designation": placement.designation,
|
|
||||||
"deadline": deadline_datetime.strftime("%A, %-d %B %Y, %-I:%M %p"),
|
|
||||||
"link": PLACEMENT_OPENING_URL.format(id=placement.designation)
|
|
||||||
}
|
|
||||||
sendEmail(student_user.email, subject, data, NOTIFY_STUDENTS_OPENING_TEMPLATE)
|
|
||||||
except Http404:
|
except Http404:
|
||||||
logger.warning('Utils - send_opening_notifications: user not found : ' + student.id)
|
logger.warning('Utils - send_opening_notifications: user not found : ' + student.id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning('Utils - send_opening_notifications: For Loop' + str(e))
|
logger.warning('Utils - send_opening_notifications: For Loop' + str(e))
|
||||||
|
subject = NOTIFY_STUDENTS_OPENING_TEMPLATE_SUBJECT.format(
|
||||||
|
company_name=opening.company_name)
|
||||||
|
deadline_datetime = opening.deadline_datetime.astimezone(pytz.timezone('Asia/Kolkata'))
|
||||||
|
data = {
|
||||||
|
"company_name": opening.company_name,
|
||||||
|
"opening_type": "INTERNSHIP" if isinstance(opening, Internship) else "PLACEMENT",
|
||||||
|
"designation": opening.designation,
|
||||||
|
"deadline": deadline_datetime.strftime("%A, %-d %B %Y, %-I:%M %p"),
|
||||||
|
"link": PLACEMENT_OPENING_URL.format(id=opening.designation) if opening_type == PLACEMENT else INTERNSHIP_OPENING_URL.format(id=opening.designation),
|
||||||
|
}
|
||||||
|
sendEmail(emails, subject, data, NOTIFY_STUDENTS_OPENING_TEMPLATE) #handled multiple mailings
|
||||||
except:
|
except:
|
||||||
logger.warning('Utils - send_opening_notifications: ' + str(sys.exc_info()))
|
logger.warning('Utils - send_opening_notifications: ' + str(sys.exc_info()))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def get_eligible_emails(opening_id, opening_type='PLACEMENT', send_all=False):
|
||||||
|
try:
|
||||||
|
if opening_type == 'PLACEMENT':
|
||||||
|
opening = get_object_or_404(Placement, id=opening_id)
|
||||||
|
else:
|
||||||
|
opening = get_object_or_404(Internship, id=opening_id)
|
||||||
|
|
||||||
|
emails = []
|
||||||
|
students = Student.objects.all()
|
||||||
|
|
||||||
|
for student in students.iterator():
|
||||||
|
if student.branch in opening.allowed_branch and student.degree in opening.eligiblestudents:
|
||||||
|
if student.degree == 'Btech' and student.batch in opening.allowed_batch:
|
||||||
|
if (isinstance(opening, Placement) and PlacementApplicationConditions(student, opening)[0]) or (
|
||||||
|
isinstance(opening, Internship) and InternshipApplicationConditions(student, opening)[0]):
|
||||||
|
if (opening_type == 'PLACEMENT' and student.can_apply) or (
|
||||||
|
opening_type == 'INTERNSHIP' and student.can_apply_internship):
|
||||||
|
student_user = get_object_or_404(User, id=student.id)
|
||||||
|
|
||||||
|
# if send_all True send all students eligible for the opening
|
||||||
|
if send_all:
|
||||||
|
emails.append(student_user.email)
|
||||||
|
continue
|
||||||
|
|
||||||
|
# check if the student applied
|
||||||
|
if opening_type == 'PLACEMENT':
|
||||||
|
if PlacementApplication.objects.filter(student=student, placement=opening).exists():
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
if InternshipApplication.objects.filter(student=student, internship=opening).exists():
|
||||||
|
continue
|
||||||
|
|
||||||
|
emails.append(student_user.email)
|
||||||
|
|
||||||
|
return True, emails
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning('Utils - send_opening_notifications: ' + str(e))
|
||||||
|
return False, []
|
||||||
|
|
||||||
|
|
||||||
def exception_email(opening):
|
def exception_email(opening):
|
||||||
opening = opening.dict()
|
opening = opening.dict()
|
||||||
data = {
|
data = {
|
||||||
"designation": opening["designation"],
|
"designation": opening["designation"],
|
||||||
"opening_type": PLACEMENT,
|
"opening_type": "INTERNSHIP" if opening["opening_type"] == "INF" else "PLACEMENT",
|
||||||
"company_name": opening["company_name"],
|
"company_name": opening["company_name"],
|
||||||
}
|
}
|
||||||
pdfhtml = opening_description_table_html(opening)
|
pdfhtml = opening_description_table_html(opening)
|
||||||
name = opening["company_name"] + '_jnf_response.pdf'
|
name = opening["company_name"] + '_jnf_response.pdf' if opening[OPENING_TYPE]!="INF" else opening["company_name"] + '_inf_response.pdf'
|
||||||
attachment_jnf_respone = {
|
attachment_jnf_respone = {
|
||||||
"name": name,
|
"name": name,
|
||||||
"html": pdfhtml,
|
"html": pdfhtml,
|
||||||
|
@ -433,6 +556,10 @@ def store_all_files(request):
|
||||||
for file in files.getlist(COMPENSATION_DETAILS_PDF):
|
for file in files.getlist(COMPENSATION_DETAILS_PDF):
|
||||||
file_location = STORAGE_DESTINATION_COMPANY_ATTACHMENTS + "temp" + '/'
|
file_location = STORAGE_DESTINATION_COMPANY_ATTACHMENTS + "temp" + '/'
|
||||||
saveFile(file, file_location)
|
saveFile(file, file_location)
|
||||||
|
#stipend details pdf for internships
|
||||||
|
for file in files.getlist(STIPEND_DETAILS_PDF):
|
||||||
|
file_location = STORAGE_DESTINATION_COMPANY_ATTACHMENTS + "temp" + '/'
|
||||||
|
saveFile(file, file_location)
|
||||||
# selection procedure details pdf
|
# selection procedure details pdf
|
||||||
for file in files.getlist(SELECTION_PROCEDURE_DETAILS_PDF):
|
for file in files.getlist(SELECTION_PROCEDURE_DETAILS_PDF):
|
||||||
file_location = STORAGE_DESTINATION_COMPANY_ATTACHMENTS + "temp" + '/'
|
file_location = STORAGE_DESTINATION_COMPANY_ATTACHMENTS + "temp" + '/'
|
||||||
|
@ -473,3 +600,23 @@ def send_email_for_opening(opening):
|
||||||
print("An error occurred while sending the email:", e)
|
print("An error occurred while sending the email:", e)
|
||||||
|
|
||||||
|
|
||||||
|
@background_task.background(schedule=2)
|
||||||
|
def send_opening_to_notifications_service(id,name,deadline,role,opening_type=PLACEMENT):
|
||||||
|
data={
|
||||||
|
"id":id,
|
||||||
|
"company":name,
|
||||||
|
"deadline":deadline,
|
||||||
|
"role":role,
|
||||||
|
"opening_type":opening_type
|
||||||
|
}
|
||||||
|
encoded=jwt.encode(data,os.environ.get("JWT_SECRET_KEY"),algorithm="HS256")
|
||||||
|
data_={
|
||||||
|
"token":encoded,
|
||||||
|
}
|
||||||
|
resp=rq.post(url=os.environ.get("PUSH_API_URL")+"addopening/",data=data_)
|
||||||
|
if resp.status_code==200:
|
||||||
|
print("Notification Sent")
|
||||||
|
else:
|
||||||
|
print("Notification Failed")
|
||||||
|
logger.warning("Utils - send_opening_to_notifications_service: " + str(resp) + "data sent:"+str(data))
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ DEBUG = os.environ.get('DEBUG') == "True"
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['cdc.iitdh.ac.in', 'localhost']
|
ALLOWED_HOSTS = ['cdc.iitdh.ac.in', 'localhost']
|
||||||
|
|
||||||
ADMINS = [ ('Karthik Mv', '200010030@iitdh.ac.in')]
|
ADMINS = [ ('Jaya Surya', '210020051@iitdh.ac.in')]
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
@ -47,7 +47,8 @@ INSTALLED_APPS = [
|
||||||
'background_task',
|
'background_task',
|
||||||
'simple_history',
|
'simple_history',
|
||||||
'import_export',
|
'import_export',
|
||||||
'django_extensions'
|
'django_extensions',
|
||||||
|
'django_crontab',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
@ -142,10 +143,10 @@ DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static_url/'
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static_url')
|
||||||
STATICFILES_DIR = (
|
STATICFILES_DIR = (
|
||||||
os.path.join(BASE_DIR, 'static'),
|
os.path.join(BASE_DIR, 'static_url'),
|
||||||
)
|
)
|
||||||
|
|
||||||
CORS_ORIGIN_ALLOW_ALL = False
|
CORS_ORIGIN_ALLOW_ALL = False
|
||||||
|
@ -203,3 +204,7 @@ LOGGING = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# django_heroku.settings(locals())
|
# django_heroku.settings(locals())
|
||||||
|
|
||||||
|
CRONJOBS = [
|
||||||
|
('0 8,20 * * *', 'APIs.cron.clean_up_tests')
|
||||||
|
]
|
|
@ -4,5 +4,4 @@ from django.urls import path, include
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('api/', include('APIs.urls')),
|
path('api/', include('APIs.urls')),
|
||||||
path('internapi/', include('internAPIs.urls'))
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
from .models import *
|
|
||||||
|
|
||||||
admin.site.register(Internship)
|
|
||||||
|
|
||||||
admin.site.register(Season)
|
|
||||||
|
|
||||||
admin.site.register(InternshipApplication)
|
|
|
@ -1,6 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class InternapisConfig(AppConfig):
|
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
|
||||||
name = 'internAPIs'
|
|
|
@ -1,7 +0,0 @@
|
||||||
from django.urls import path
|
|
||||||
|
|
||||||
from . import companyViews
|
|
||||||
|
|
||||||
urlpatterns = [
|
|
||||||
path('addInternship/', companyViews.addInternship, name="Add Internship"),
|
|
||||||
]
|
|
|
@ -1,4 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
def addInternship(request):
|
|
||||||
pass
|
|
|
@ -1,189 +0,0 @@
|
||||||
import os
|
|
||||||
|
|
||||||
BRANCH_CHOICES = [
|
|
||||||
["CSE", "CSE"],
|
|
||||||
["EE", "EE"],
|
|
||||||
["ME", "ME"],
|
|
||||||
['MMAE', 'MMAE'],
|
|
||||||
['EP', 'EP'],
|
|
||||||
]
|
|
||||||
BRANCHES = [
|
|
||||||
"CSE",
|
|
||||||
"EE",
|
|
||||||
"MMAE",
|
|
||||||
"EP"
|
|
||||||
]
|
|
||||||
BATCH_CHOICES = [
|
|
||||||
["2021", "2021"],
|
|
||||||
["2020", "2020"],
|
|
||||||
["2019", "2019"],
|
|
||||||
["2018", "2018"],
|
|
||||||
["2017", "2017"],
|
|
||||||
]
|
|
||||||
|
|
||||||
OFFER_CITY_TYPE = [
|
|
||||||
['Domestic', 'Domestic'],
|
|
||||||
['International', 'International']
|
|
||||||
]
|
|
||||||
|
|
||||||
FACILITIES_PROVIDED = [
|
|
||||||
['Accommodation', 'Accommodation'],
|
|
||||||
['Food', 'Food'],
|
|
||||||
['Transport', 'Transport'],
|
|
||||||
['Medical', 'Medical'],
|
|
||||||
]
|
|
||||||
|
|
||||||
TOTAL_FACILITIES = 4
|
|
||||||
|
|
||||||
TIERS = [
|
|
||||||
['psu', 'PSU'],
|
|
||||||
['1', 'Tier 1'],
|
|
||||||
['2', 'Tier 2'],
|
|
||||||
['3', 'Tier 3'],
|
|
||||||
['4', 'Tier 4'],
|
|
||||||
['5', 'Tier 5'],
|
|
||||||
['6', 'Tier 6'],
|
|
||||||
['7', 'Tier 7'],
|
|
||||||
]
|
|
||||||
|
|
||||||
SEASON_CHOICES = (
|
|
||||||
['summer', 'Summer'],
|
|
||||||
['winter', 'Winter'],
|
|
||||||
['autumn', 'Autumn'],
|
|
||||||
['spring', 'Spring'],
|
|
||||||
)
|
|
||||||
|
|
||||||
DEGREE_CHOICES = [
|
|
||||||
['bTech', 'B.Tech'],
|
|
||||||
['ms/phd', 'MS/ PhD'],
|
|
||||||
]
|
|
||||||
|
|
||||||
TOTAL_BRANCHES = 4 # Total No of Branches
|
|
||||||
TOTAL_BATCHES = 5 # Total No of Batches
|
|
||||||
|
|
||||||
CDC_MAIl_ADDRESS = '2000'
|
|
||||||
|
|
||||||
# To be Configured Properly
|
|
||||||
CLIENT_ID = os.environ.get('GOOGLE_OAUTH_CLIENT_ID') # Google Login Client ID
|
|
||||||
|
|
||||||
# To be Configured Properly
|
|
||||||
PLACEMENT_OPENING_URL = "https://cdc.iitdh.ac.in/portal/student/dashboard/placements/{id}" # On frontend, this is the URL to be opened
|
|
||||||
LINK_TO_STORAGE_COMPANY_ATTACHMENT = "https://cdc.iitdh.ac.in/storage/Company_Attachments/"
|
|
||||||
LINK_TO_STORAGE_RESUME = "https://cdc.iitdh.ac.in/storage/Resumes/"
|
|
||||||
LINK_TO_APPLICATIONS_CSV = "https://cdc.iitdh.ac.in/storage/Application_CSV/"
|
|
||||||
LINK_TO_EMAIl_VERIFICATION_API = "https://cdc.iitdh.ac.in/portal/company/verifyEmail?token={token}"
|
|
||||||
PDF_FILES_SERVING_ENDPOINT = 'https://cdc.iitdh.ac.in/storage/Company_Attachments/' # TODO: Change this to actual URL
|
|
||||||
|
|
||||||
EMAIL = "email"
|
|
||||||
|
|
||||||
STUDENT = 'student'
|
|
||||||
ADMIN = 'admin'
|
|
||||||
SUPER_ADMIN = 's_admin'
|
|
||||||
COMPANY = 'company'
|
|
||||||
TIER = 'tier'
|
|
||||||
# To be Configured Properly
|
|
||||||
FOURTH_YEAR = '2020'
|
|
||||||
MAX_OFFERS_PER_STUDENT = 2
|
|
||||||
MAX_RESUMES_PER_STUDENT = 3
|
|
||||||
EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours
|
|
||||||
INF_TEXT_MAX_CHARACTER_COUNT = 100
|
|
||||||
INF_TEXTMEDIUM_MAX_CHARACTER_COUNT = 200
|
|
||||||
INF_TEXTAREA_MAX_CHARACTER_COUNT = 1000
|
|
||||||
INF_SMALLTEXT_MAX_CHARACTER_COUNT = 50
|
|
||||||
|
|
||||||
STORAGE_DESTINATION_RESUMES = "./Storage/Resumes/"
|
|
||||||
STORAGE_DESTINATION_COMPANY_ATTACHMENTS = './Storage/Company_Attachments/'
|
|
||||||
STORAGE_DESTINATION_APPLICATION_CSV = './Storage/Application_CSV/'
|
|
||||||
|
|
||||||
TOKEN = 'token'
|
|
||||||
RESUME_FILE_NAME = 'resume_file_name'
|
|
||||||
|
|
||||||
APPLICATION_ID = "application_id"
|
|
||||||
OPENING_ID = "opening_id"
|
|
||||||
ADDITIONAL_INFO = "additional_info"
|
|
||||||
FIELD = "field"
|
|
||||||
|
|
||||||
STATUS_ACCEPTING_APPLICATIONS = "Accepting Applications"
|
|
||||||
|
|
||||||
PLACEMENT = "Placement"
|
|
||||||
|
|
||||||
COMPANY_NAME = "company_name"
|
|
||||||
ADDRESS = "address"
|
|
||||||
COMPANY_TYPE = "company_type"
|
|
||||||
NATURE_OF_BUSINESS = "nature_of_business"
|
|
||||||
TYPE_OF_ORGANISATION = "type_of_organisation"
|
|
||||||
WEBSITE = 'website'
|
|
||||||
COMPANY_DETAILS = "company_details"
|
|
||||||
COMPANY_DETAILS_PDF = "company_details_pdf"
|
|
||||||
IS_COMPANY_DETAILS_PDF = "is_company_details_pdf"
|
|
||||||
COMPANY_DETAILS_PDF_NAMES = "company_details_pdf_names"
|
|
||||||
PHONE_NUMBER = 'phone_number'
|
|
||||||
CONTACT_PERSON_NAME = 'contact_person_name'
|
|
||||||
CITY = 'city'
|
|
||||||
STATE = 'state'
|
|
||||||
COUNTRY = 'country'
|
|
||||||
PINCODE = 'pincode'
|
|
||||||
|
|
||||||
DESIGNATION = 'designation'
|
|
||||||
DESCRIPTION = 'description'
|
|
||||||
DESCRIPTION_PDF = 'description_pdf'
|
|
||||||
DESCRIPTION_PDF_NAMES = 'description_pdf_names'
|
|
||||||
IS_DESCRIPTION_PDF = 'is_description_pdf'
|
|
||||||
OPENING_TYPE = 'opening_type'
|
|
||||||
JOB_LOCATION = 'job_location'
|
|
||||||
COMPENSATION_CTC = 'compensation_ctc'
|
|
||||||
COMPENSATION_GROSS = 'compensation_gross'
|
|
||||||
COMPENSATION_TAKE_HOME = 'compensation_take_home'
|
|
||||||
COMPENSATION_BONUS = 'compensation_bonus'
|
|
||||||
COMPENSATION_DETAILS = 'compensation_details'
|
|
||||||
COMPENSATION_DETAILS_PDF = 'compensation_details_pdf'
|
|
||||||
COMPENSATION_DETAILS_PDF_NAMES = 'compensation_details_pdf_names'
|
|
||||||
IS_COMPENSATION_DETAILS_PDF = 'is_compensation_details_pdf'
|
|
||||||
ALLOWED_BATCH = 'allowed_batch'
|
|
||||||
ALLOWED_BRANCH = 'allowed_branch'
|
|
||||||
RS_ELIGIBLE = 'rs_eligible'
|
|
||||||
BOND_DETAILS = 'bond_details'
|
|
||||||
SELECTION_PROCEDURE_ROUNDS = 'selection_procedure_rounds'
|
|
||||||
SELECTION_PROCEDURE_DETAILS = 'selection_procedure_details'
|
|
||||||
SELECTION_PROCEDURE_DETAILS_PDF = 'selection_procedure_details_pdf'
|
|
||||||
SELECTION_PROCEDURE_DETAILS_PDF_NAMES = 'selection_procedure_details_pdf_names'
|
|
||||||
IS_SELECTION_PROCEDURE_DETAILS_PDF = 'is_selection_procedure_details_pdf'
|
|
||||||
TENTATIVE_DATE_OF_JOINING = 'tentative_date_of_joining'
|
|
||||||
TENTATIVE_NO_OF_OFFERS = 'tentative_no_of_offers'
|
|
||||||
OTHER_REQUIREMENTS = 'other_requirements'
|
|
||||||
DEADLINE_DATETIME = 'deadline_datetime'
|
|
||||||
OFFER_ACCEPTED = 'offer_accepted'
|
|
||||||
EMAIL_VERIFIED = 'email_verified'
|
|
||||||
RECAPTCHA_VALUE = 'recaptchakey'
|
|
||||||
|
|
||||||
STUDENT_LIST = "student_list"
|
|
||||||
STUDENT_ID = "student_id"
|
|
||||||
STUDENT_SELECTED = "student_selected"
|
|
||||||
|
|
||||||
EXCLUDE_IN_PDF = ['id', 'is_company_details_pdf', 'offer_accepted', 'is_description_pdf',
|
|
||||||
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf',
|
|
||||||
'email_verified', 'created_at']
|
|
||||||
SPECIAL_FORMAT_IN_PDF = ['website', 'company_details_pdf_names', 'description_pdf_names',
|
|
||||||
'compensation_details_pdf_names',
|
|
||||||
'selection_procedure_details_pdf_names']
|
|
||||||
|
|
||||||
COMPANY_OPENING_ERROR_TEMPLATE = "Alert! Error submitting opening for {company_name}."
|
|
||||||
COMPANY_OPENING_SUBMITTED_TEMPLATE_SUBJECT = "Notification Submitted - {id} - Career Development Cell, IIT Dharwad"
|
|
||||||
STUDENT_APPLICATION_STATUS_TEMPLATE_SUBJECT = 'Application Status - {company_name} - {id}'
|
|
||||||
STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT = 'CDC - Application Submitted - {company_name}'
|
|
||||||
STUDENT_APPLICATION_UPDATED_TEMPLATE_SUBJECT = 'CDC - Application Updated - {company_name}'
|
|
||||||
COMPANY_EMAIl_VERIFICATION_TEMPLATE_SUBJECT = 'Email Verification - Career Development Cell, IIT Dharwad'
|
|
||||||
NOTIFY_STUDENTS_OPENING_TEMPLATE_SUBJECT = 'Placement Opportunity at {company_name}'
|
|
||||||
|
|
||||||
STUDENT_APPLICATION_SUBMITTED_TEMPLATE = 'student_application_submitted.html'
|
|
||||||
COMPANY_OPENING_SUBMITTED_TEMPLATE = 'company_opening_submitted.html'
|
|
||||||
STUDENT_APPLICATION_STATUS_SELECTED_TEMPLATE = 'student_application_status_selected.html'
|
|
||||||
STUDENT_APPLICATION_STATUS_NOT_SELECTED_TEMPLATE = 'student_application_status_not_selected.html'
|
|
||||||
STUDENT_APPLICATION_UPDATED_TEMPLATE = 'student_application_updated.html'
|
|
||||||
COMPANY_EMAIL_VERIFICATION_TEMPLATE = 'company_email_verification.html'
|
|
||||||
COMPANY_JNF_RESPONSE_TEMPLATE = 'company_jnf_response.html'
|
|
||||||
NOTIFY_STUDENTS_OPENING_TEMPLATE = 'notify_students_new_opening.html'
|
|
||||||
|
|
||||||
APPLICATION_CSV_COL_NAMES = ['Applied At', 'Roll No.', 'Name', 'Email', 'Phone Number', 'Branch', 'Batch', 'CPI',
|
|
||||||
'Resume', 'Selected', ]
|
|
||||||
|
|
|
@ -1,187 +0,0 @@
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
from django.contrib.postgres.fields import ArrayField
|
|
||||||
from django.db import models
|
|
||||||
from django.utils import timezone
|
|
||||||
from simple_history.models import HistoricalRecords
|
|
||||||
|
|
||||||
from .constants import *
|
|
||||||
|
|
||||||
#import models from other apps
|
|
||||||
from APIs.models import User,Student
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
class Internship(models.Model):
|
|
||||||
id = models.CharField(blank=False, primary_key=True, max_length=15) #unique id for each internship
|
|
||||||
# Company Details
|
|
||||||
company_name = models.CharField(blank=False, max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT)
|
|
||||||
address = models.CharField(blank=False, max_length=INF_TEXTAREA_MAX_CHARACTER_COUNT)
|
|
||||||
company_type = models.CharField(blank=False, max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT)
|
|
||||||
nature_of_business = models.CharField(blank=False, max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
|
||||||
type_of_organisation = models.CharField(max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT, default="", blank=False)
|
|
||||||
website = models.CharField(blank=True, max_length=INF_TEXT_MAX_CHARACTER_COUNT)
|
|
||||||
company_details = models.CharField(max_length=INF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True, blank=True)
|
|
||||||
company_details_pdf_names = ArrayField(
|
|
||||||
models.CharField(null=True, default=None, max_length=INF_TEXT_MAX_CHARACTER_COUNT), size=5,
|
|
||||||
default=list, blank=True)
|
|
||||||
is_company_details_pdf = models.BooleanField(blank=False, default=False)
|
|
||||||
#Company Address
|
|
||||||
city = models.CharField(blank=False, max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
|
||||||
state = models.CharField(blank=False, max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
|
||||||
country = models.CharField(blank=False, max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
|
||||||
pin_code = models.IntegerField(blank=False, default=None, null=True)
|
|
||||||
# selection process
|
|
||||||
selection_procedure_rounds = ArrayField(
|
|
||||||
models.CharField(null=True, default=None, max_length=INF_TEXT_MAX_CHARACTER_COUNT), size=10,
|
|
||||||
default=list, blank=True)
|
|
||||||
selection_procedure_details = models.CharField(blank=True, max_length=INF_TEXTAREA_MAX_CHARACTER_COUNT)
|
|
||||||
selection_procedure_details_pdf_names = ArrayField(
|
|
||||||
models.CharField(null=True, default=None, max_length=INF_TEXT_MAX_CHARACTER_COUNT),
|
|
||||||
size=5, default=list, blank=True)
|
|
||||||
is_selection_procedure_details_pdf = models.BooleanField(blank=False, default=False)
|
|
||||||
#Internship Details
|
|
||||||
description_pdf_names = ArrayField(
|
|
||||||
models.CharField(null=True, default=None, max_length=INF_TEXT_MAX_CHARACTER_COUNT), size=5, default=list,
|
|
||||||
blank=True)
|
|
||||||
is_description_pdf = models.BooleanField(blank=False, default=False)
|
|
||||||
description = models.CharField(blank=False, max_length=INF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
|
||||||
interning_period_from = models.DateField(blank=False, default=None, null=True)
|
|
||||||
interning_period_to = models.DateField(blank=False, default=None, null=True)
|
|
||||||
season = models.CharField(blank=False, max_length=10, choices=SEASON_CHOICES, default=None)
|
|
||||||
is_work_from_home = models.BooleanField(blank=False, default=False)
|
|
||||||
sophomore_eligible = models.BooleanField(blank=False, default=False)
|
|
||||||
tentative_no_of_offers = models.IntegerField(blank=False, default=None, null=True)
|
|
||||||
stipend_description_pdf_names=ArrayField(
|
|
||||||
models.CharField(null=True, default=None, max_length=INF_TEXT_MAX_CHARACTER_COUNT), size=5, default=list,
|
|
||||||
blank=True)
|
|
||||||
is_stipend_description_pdf = models.BooleanField(blank=False, default=False)
|
|
||||||
stipend=models.IntegerField(blank=False, default=None, null=True)
|
|
||||||
facilities_provided=ArrayField(
|
|
||||||
models.CharField(choices=FACILITIES_PROVIDED, blank=False, max_length=20),
|
|
||||||
size=TOTAL_FACILITIES,
|
|
||||||
default=list
|
|
||||||
)
|
|
||||||
additional_facilities = models.CharField(blank=True, max_length=INF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
|
||||||
academic_requirements = models.CharField(blank=True, max_length=INF_TEXTAREA_MAX_CHARACTER_COUNT, default=None, null=True)
|
|
||||||
#contact details of company person
|
|
||||||
contact_person_name = models.CharField(blank=False, max_length=INF_TEXT_MAX_CHARACTER_COUNT)
|
|
||||||
phone_number = models.PositiveBigIntegerField(blank=False)
|
|
||||||
email = models.EmailField(blank=False)
|
|
||||||
contact_person_designation = models.CharField(blank=False, max_length=INF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
|
|
||||||
telephone_number = models.PositiveBigIntegerField(blank=True, default=None, null=True)
|
|
||||||
email_verified = models.BooleanField(blank=False, default=False)
|
|
||||||
#history
|
|
||||||
created_at = models.DateTimeField(blank=False, default=None, null=True)
|
|
||||||
updated_at = models.DateTimeField(blank=False, default=None, null=True)
|
|
||||||
changed_by = models.ForeignKey(User, on_delete=models.CASCADE, blank=True, null=True)
|
|
||||||
history = HistoricalRecords(user_model=User)
|
|
||||||
|
|
||||||
|
|
||||||
def format(self):
|
|
||||||
if self.company_name is not None:
|
|
||||||
self.company_name = self.company_name.strip()[:INF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.company_type is not None:
|
|
||||||
self.company_type = self.company_type.strip()[:INF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.company_details is not None:
|
|
||||||
self.company_details = self.company_details.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.address is not None:
|
|
||||||
self.address = self.address.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.nature_of_business is not None:
|
|
||||||
self.nature_of_business = self.nature_of_business.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.type_of_organisation is not None:
|
|
||||||
self.type_of_organisation = self.type_of_organisation.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.website is not None:
|
|
||||||
self.website = self.website.strip()[:INF_TEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.contact_person_name is not None:
|
|
||||||
self.contact_person_name = self.contact_person_name.strip()[:INF_TEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.city is not None:
|
|
||||||
self.city = self.city.strip()[:INF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.state is not None:
|
|
||||||
self.state = self.state.strip()[:INF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.country is not None:
|
|
||||||
self.country = self.country.strip()[:INF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.city_type is not None:
|
|
||||||
self.city_type = self.city_type.strip()[:INF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
|
||||||
if self.selection_procedure_details is not None:
|
|
||||||
self.selection_procedure_details = self.selection_procedure_details.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.description is not None:
|
|
||||||
self.description = self.description.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.additional_facilities is not None:
|
|
||||||
self.additional_facilities = self.additional_facilities.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.academic_requirements is not None:
|
|
||||||
self.academic_requirements = self.academic_requirements.strip()[:INF_TEXTAREA_MAX_CHARACTER_COUNT]
|
|
||||||
if self.contact_person_designation is not None:
|
|
||||||
self.contact_person_designation = self.contact_person_designation.strip()[:INF_SMALLTEXT_MAX_CHARACTER_COUNT]
|
|
||||||
|
|
||||||
@property
|
|
||||||
def _history_user(self):
|
|
||||||
return self.changed_by
|
|
||||||
|
|
||||||
@_history_user.setter
|
|
||||||
def _history_user(self, value):
|
|
||||||
if isinstance(value, User):
|
|
||||||
self.changed_by = value
|
|
||||||
else:
|
|
||||||
self.changed_by = None
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
|
||||||
''' On save, add timestamps '''
|
|
||||||
if not self.created_at:
|
|
||||||
self.created_at = timezone.now()
|
|
||||||
self.format()
|
|
||||||
self.updated_at = timezone.now()
|
|
||||||
return super(Internship, self).save(*args, **kwargs)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.company_name + " - " + self.id
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Season(models.Model):
|
|
||||||
|
|
||||||
season = models.CharField(max_length=10, choices=SEASON_CHOICES, unique=True)
|
|
||||||
student = models.ForeignKey(Student, on_delete=models.CASCADE, default=None)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.season + " Season - " + self.student.id
|
|
||||||
|
|
||||||
class InternshipApplication(models.Model):
|
|
||||||
id = models.CharField(blank=False, primary_key=True, max_length=15) #unique id for each internship
|
|
||||||
internship=models.ForeignKey(Internship,blank=False, on_delete=models.CASCADE, default=None)
|
|
||||||
student=models.ForeignKey(Student,blank=False, on_delete=models.CASCADE, default=None)
|
|
||||||
resume = models.CharField(max_length=INF_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)
|
|
||||||
history = HistoricalRecords(user_model=User)
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
|
||||||
''' On save, add timestamps '''
|
|
||||||
if not self.applied_at:
|
|
||||||
self.applied_at = timezone.now()
|
|
||||||
self.updated_at = timezone.now()
|
|
||||||
|
|
||||||
return super(InternshipApplication, self).save(*args, **kwargs)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def _history_user(self):
|
|
||||||
return self.changed_by
|
|
||||||
|
|
||||||
@_history_user.setter
|
|
||||||
def _history_user(self, value):
|
|
||||||
if isinstance(value, User):
|
|
||||||
self.changed_by = value
|
|
||||||
else:
|
|
||||||
self.changed_by = None
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name_plural = "Internship Applications"
|
|
||||||
unique_together = ('internship', 'student')
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.internship.company_name + " - " + self.student.name
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
|
@ -1,7 +0,0 @@
|
||||||
from django.urls import path, include
|
|
||||||
|
|
||||||
from . import companyUrls
|
|
||||||
|
|
||||||
urlpatterns = [
|
|
||||||
path('company/', include(companyUrls)),
|
|
||||||
]
|
|
|
@ -1,3 +0,0 @@
|
||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
# Create your views here.
|
|
|
@ -1 +1 @@
|
||||||
gunicorn --certfile=/home/cdc/Desktop/1f9476e3959ebe60.crt --keyfile=/home/cdc/Desktop/star_iitdh_key.key --bind localhost:8000 CDC_Backend.wsgi --access-logfile access.log --error-logfile error.log --forwarded-allow-ips="cdc.iitdh.ac.in" &
|
gunicorn --certfile=/home/cdc/Desktop/1f9476e3959ebe60.crt --keyfile=/home/cdc/Desktop/star_iitdh_key.key --bind localhost:8000 CDC_Backend.wsgi --access-logfile access.log --error-logfile error.log --forwarded-allow-ips="cdc.iitdh.ac.in"
|
||||||
|
|
|
@ -1,90 +1,196 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="x-apple-disable-message-reformatting">
|
<meta name="x-apple-disable-message-reformatting" />
|
||||||
<title></title>
|
<title>Email Template</title>
|
||||||
<!--[if mso]>
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
<noscript>
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
<xml>
|
<link
|
||||||
<o:OfficeDocumentSettings>
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap"
|
||||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
rel="stylesheet"
|
||||||
</o:OfficeDocumentSettings>
|
/>
|
||||||
</xml>
|
|
||||||
</noscript>
|
|
||||||
<![endif]-->
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body,
|
||||||
font-family: 'Roboto', sans-serif;
|
table,
|
||||||
|
td,
|
||||||
|
div,
|
||||||
|
p,
|
||||||
|
h1 {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header,
|
||||||
|
.email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body,
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body>
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<div class="email-wrapper">
|
||||||
<tr>
|
<table role="presentation" class="email-container">
|
||||||
<td align="center" style="padding:0;">
|
<tr>
|
||||||
<table role="presentation"
|
<td>
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
<div class="email-header">
|
||||||
<tr>
|
<img
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png"
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
alt="CDC Logo"
|
||||||
style="height:auto;display:block;"/>
|
style="width: 35%; height: auto; display: block; margin: 0 auto"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="inner-container">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
<div class="email-body">
|
||||||
<table role="presentation"
|
<img
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
src="https://cdc.iitdh.ac.in/storage/Images/Approved.png"
|
||||||
<tr>
|
alt="verify Logo"
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
style="
|
||||||
|
width: 35%;
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<h2 style="text-align: center">Verification Required</h2>
|
||||||
|
<p style="text-align: center">
|
||||||
|
We have received your
|
||||||
|
<strong>{{opening_type}}</strong> Notification for
|
||||||
|
<strong>{{designation}}</strong>. Please verify your email by
|
||||||
|
clicking the button below:
|
||||||
|
</p>
|
||||||
|
<p style="text-align: center">
|
||||||
|
<a
|
||||||
|
href="{{one_time_link}}"
|
||||||
|
style="
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 50px;
|
||||||
|
font-weight: 500;
|
||||||
|
"
|
||||||
|
>Verify Email</a
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="email-footer">
|
||||||
|
<p style="margin-bottom: 16px; color: #555555">Follow us on:</p>
|
||||||
|
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
<a
|
||||||
We have received your {{opening_type}} Notification for {{ designation }}. Kindly verify your email by clicking <a
|
href="https://twitter.com/cdc_iitdh"
|
||||||
href="{{ one_time_link }}">here</a>.
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
</p>
|
>
|
||||||
</td>
|
<img
|
||||||
</tr>
|
src="https://cdc.iitdh.ac.in/storage/Images/twitter.png"
|
||||||
<tr>
|
alt="Twitter"
|
||||||
<td style="padding:0;">
|
style="width: 24px; height: 24px"
|
||||||
<table role="presentation"
|
/>
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
</a>
|
||||||
<tr>
|
<a
|
||||||
<td style="width:260px;padding:0;vertical-align:top;color:#334878;">
|
href="https://www.instagram.com/cdc.iitdh/?hl=en"
|
||||||
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
|
>
|
||||||
</td>
|
<img
|
||||||
</tr>
|
src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png"
|
||||||
</table>
|
alt="Instagram"
|
||||||
</td>
|
style="width: 24px; height: 24px"
|
||||||
</tr>
|
/>
|
||||||
</table>
|
</a>
|
||||||
</td>
|
<a
|
||||||
</tr>
|
href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in"
|
||||||
<tr>
|
>
|
||||||
<td style="padding:30px;background:#334878;">
|
<img
|
||||||
<table role="presentation"
|
src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png"
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
alt="LinkedIn"
|
||||||
<tr>
|
style="width: 24px; height: 24px"
|
||||||
<td style="padding:0;width:50%;" align="left">
|
/>
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
</a>
|
||||||
® CDC,IIT Dharwad,2021<br/>
|
<p style="color: #555555">
|
||||||
</p>
|
copy right © 2024 CDC, all rights reserved
|
||||||
</td>
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
</tr>
|
</table>
|
||||||
</table>
|
</div>
|
||||||
</td>
|
</body>
|
||||||
</tr>
|
</html>
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -5,69 +5,188 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<style>
|
<style>
|
||||||
#details_table tr:nth-child(even) {
|
body, table, td, div, p, h1 {
|
||||||
background: #FFF
|
font-family: 'Roboto', sans-serif;
|
||||||
}
|
}
|
||||||
|
body {
|
||||||
#details_table tr:nth-child(odd) {
|
margin: 0;
|
||||||
background: #bfe3f3
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
}
|
}
|
||||||
|
.email-wrapper {
|
||||||
#details_table td {
|
padding: 20px;
|
||||||
padding: 10px;
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
width: 50%;
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header, .email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#details_table {
|
#details_table {
|
||||||
border: #334878 1px solid;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
width: 80%;
|
margin: 20px auto;
|
||||||
margin: auto;
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
#details_table th, #details_table td {
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
#details_table th {
|
||||||
|
background-color: #ff7350;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
#details_table tr:nth-child(even) {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
}
|
||||||
|
#details_table tr:nth-child(odd) {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
#details_table ul {
|
||||||
|
padding-left: 20px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#details_table a {
|
||||||
|
color: #334878;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.social-icons img {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
margin: 0 5px;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body, .email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>Document</title>
|
<title>Notification</title>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin: 0;font-family: sans-serif;">
|
<body>
|
||||||
|
|
||||||
<header style="background-color: #334878;"><img style="height: 3cm; margin: auto; display: block; padding: 0.5cm;"
|
<div class="email-wrapper">
|
||||||
src='{{ imgpath }}' alt="cdc logo"></header>
|
<div class="email-container">
|
||||||
<h1 style="text-align: center;"> {{type}} Notification Form Response</h1>
|
|
||||||
<table id="details_table">
|
|
||||||
{% for key, value in data.items %}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{{ key }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if 'list' in value.type %}
|
|
||||||
|
|
||||||
{% for item in value.details %}
|
<div class="email-header">
|
||||||
<li>
|
<img src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png" alt="CDC Logo" style="width: 35%; height: auto; display: block; margin: 0 auto;" />
|
||||||
{% if 'link' in value.type and value.link %}
|
</div>
|
||||||
<a href="{{ value.link|add:item}}">{{ item|slice:"16:" }}</a>
|
|
||||||
{% elif 'link' in value.type %}
|
|
||||||
<a href="{{ item }}">{{ item }}</a>
|
|
||||||
{% else %}
|
|
||||||
{{ item }}
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
{% if 'link' in value.type %}
|
|
||||||
<a href="{{ value.details }}">{{ value.details }}</a>
|
|
||||||
{% else %}
|
|
||||||
{{ value }}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</td>
|
<div class="inner-container">
|
||||||
</tr>
|
<div class="email-body">
|
||||||
{% endfor %}
|
<img src="https://cdc.iitdh.ac.in/storage/Images/email_2058176.png" alt="Notification Logo" style="width: 20%; height: auto; display: block; margin: 0 auto;" />
|
||||||
</table>
|
<h2 style="text-align: center;">{{type}} Notification Form Response</h2>
|
||||||
<p style="margin-left: 10%;">In case of any descripency regarding above details, please contact <a
|
<p style="text-align: center;">
|
||||||
href="mailto:cdc@iitdh.ac.in">cdc@iitdh.ac.in</a>
|
<table id="details_table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Key</th>
|
||||||
|
<th>Value</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for key, value in data.items %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ key }}</td>
|
||||||
|
<td>
|
||||||
|
{% if 'list' in value.type %}
|
||||||
|
<ul>
|
||||||
|
{% for item in value.details %}
|
||||||
|
<li>
|
||||||
|
{% if 'link' in value.type and value.link %}
|
||||||
|
<a href="{{ value.link|add:item }}" target="_blank">{{ item|slice:"16:" }}</a>
|
||||||
|
{% elif 'link' in value.type %}
|
||||||
|
<a href="{{ item }}" target="_blank">{{ item }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ item }}
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
{% if 'link' in value.type %}
|
||||||
|
<a href="{{ value.details }}" target="_blank">{{ value.details }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ value }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
In case of any discrepancy regarding the above details, please contact <a href="mailto:cdc@iitdh.ac.in">cdc@iitdh.ac.in</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</p>
|
<div class="email-footer">
|
||||||
|
<p style="margin-bottom: 16px; color: #555555;">Follow us on:</p>
|
||||||
|
<div class="social-icons">
|
||||||
|
<a href="https://twitter.com/cdc_iitdh" style="margin-right: 10px; color: #eff7ff">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/twitter.png" alt="Twitter">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.instagram.com/cdc.iitdh/?hl=en" style="margin-right: 10px; color: #eff7ff">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png" alt="Instagram">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in" style="margin-right: 10px; color: #eff7ff">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png" alt="LinkedIn">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<p style="color: #555555;">© 2024 CDC, all rights reserved</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,135 +1,213 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="x-apple-disable-message-reformatting">
|
<meta name="x-apple-disable-message-reformatting" />
|
||||||
<title></title>
|
<title></title>
|
||||||
<!--[if mso]>
|
<!--[if mso]>
|
||||||
<noscript>
|
<noscript>
|
||||||
<xml>
|
<xml>
|
||||||
<o:OfficeDocumentSettings>
|
<o:OfficeDocumentSettings>
|
||||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||||
</o:OfficeDocumentSettings>
|
</o:OfficeDocumentSettings>
|
||||||
</xml>
|
</xml>
|
||||||
</noscript>
|
</noscript>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body,
|
||||||
font-family: 'Roboto', sans-serif;
|
table,
|
||||||
|
td,
|
||||||
|
div,
|
||||||
|
h1,
|
||||||
|
p {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-container {
|
||||||
|
max-width: 600px;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
border: 8 px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
background-color: #eff7ff;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-header,
|
||||||
|
.email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-header img {
|
||||||
|
width: 200px;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px 42px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
font-size: 24px;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
color: #153643;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin: 0 0 12px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #153643;
|
||||||
|
}
|
||||||
|
|
||||||
|
#details_table {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid #334878;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
#details_table td {
|
||||||
|
padding: 10px;
|
||||||
|
color: #153643;
|
||||||
|
border: 1px solid #334878;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body,
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#details_table tr:nth-child(even) {
|
|
||||||
background: #FFF
|
|
||||||
}
|
|
||||||
|
|
||||||
#details_table tr:nth-child(odd) {
|
|
||||||
background: #f9f9f9
|
|
||||||
}
|
|
||||||
|
|
||||||
#details_table td {
|
|
||||||
padding: 10px
|
|
||||||
}
|
|
||||||
|
|
||||||
#details_table {
|
|
||||||
border: #334878 1px solid;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body>
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<div class="email-wrapper">
|
||||||
<tr>
|
<table role="presentation" class="email-container">
|
||||||
<td align="center" style="padding:0;">
|
<tr>
|
||||||
<table role="presentation"
|
<td>
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
<div class="email-header">
|
||||||
<tr>
|
<img
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png"
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
alt="CDC Logo"
|
||||||
style="height:auto;display:block;"/>
|
style="width: 35%; height: auto; display: block; margin: 0 auto"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="inner-container">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
<div class="email-body">
|
||||||
<table role="presentation"
|
<img
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
src="https://cdc.iitdh.ac.in/storage/Images/Confirmed.png"
|
||||||
<tr>
|
alt="verify Logo"
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
style="
|
||||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
width: 30%;
|
||||||
">Thank You for filling the form</h1>
|
height: auto;
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
display: block;
|
||||||
We have received your <b>{{ opening_type }}</b> notification for a
|
margin: 0 auto;
|
||||||
<b>{{ designation }}</b> offer at <b>
|
"
|
||||||
{{ company_name }}</b>.
|
/>
|
||||||
</p>
|
<h2 style="text-align: center">
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
Thank You For Filling The Form
|
||||||
We will keep you informed with the updates. If you have any queries, please
|
</h2>
|
||||||
feel to
|
<p style="text-align: center">
|
||||||
write to
|
We have received your <b>{{ opening_type }}</b> notification
|
||||||
<nobr><u>cdc@iitdh.ac.in</u></nobr>
|
for a <b>{{ designation }}</b> offer at
|
||||||
</p>
|
<b>{{ company_name }}</b>. We will keep you informed with the
|
||||||
<table id="details_table">
|
updates. If you have any queries, please feel free to write to
|
||||||
{% for key, value in data.items %}
|
<nobr><u>cdc@iitdh.ac.in</u></nobr
|
||||||
<tr>
|
>.
|
||||||
<td>
|
</p>
|
||||||
{{ key }}
|
<!-- <table id="details_table">
|
||||||
</td>
|
{% for key, value in data.items %}
|
||||||
<td>
|
<tr>
|
||||||
{% if 'list' in value.type %}
|
<td>{{ key }}</td>
|
||||||
|
<td>
|
||||||
{% for item in value.details %}
|
{% if 'list' in value.type %}
|
||||||
<li>
|
<ul>
|
||||||
{% if 'link' in value.type and value.link %}
|
{% for item in value.details %}
|
||||||
<a href="{{ value.link|add:item}}">{{ item }}</a>
|
<li>{% if 'link' in value.type and value.link %}<a href="{{ value.link|add:item}}">{{ item }}</a>{% elif 'link' in value.type %}<a href="{{ item }}">{{ item }}</a>{% else %}{{ item }}{% endif %}</li>
|
||||||
{% elif 'link' in value.type %}
|
|
||||||
<a href="{{ item }}">{{ item }}</a>
|
|
||||||
{% else %}
|
|
||||||
{{ item }}
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
{% if 'link' in value.type %}
|
|
||||||
<a href="{{ value.details }}">{{ value.details }}</a>
|
|
||||||
{% else %}
|
|
||||||
{{ value }}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</ul>
|
||||||
</td>
|
{% else %}
|
||||||
</tr>
|
{% if 'link' in value.type %}<a href="{{ value.details }}">{{ value.details }}</a>{% else %}{{ value }}{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="email-footer">
|
||||||
|
<p style="margin-bottom: 16px; color: #555555">Follow us on:</p>
|
||||||
|
|
||||||
</table>
|
<a
|
||||||
</td>
|
href="https://twitter.com/cdc_iitdh"
|
||||||
</tr>
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
<tr>
|
>
|
||||||
<td style="padding:30px;background:#334878;">
|
<img
|
||||||
<table role="presentation"
|
src="https://cdc.iitdh.ac.in/storage/Images/twitter.png"
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
alt="Twitter"
|
||||||
<tr>
|
style="width: 24px; height: 24px"
|
||||||
<td style="padding:0;width:50%;" align="left">
|
/>
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
</a>
|
||||||
® CDC,IIT Dharwad,2021<br/>
|
<a
|
||||||
</p>
|
href="https://www.instagram.com/cdc.iitdh/?hl=en"
|
||||||
</td>
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
|
>
|
||||||
|
<img
|
||||||
</tr>
|
src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png"
|
||||||
</table>
|
alt="Instagram"
|
||||||
</td>
|
style="width: 24px; height: 24px"
|
||||||
</tr>
|
/>
|
||||||
</table>
|
</a>
|
||||||
</td>
|
<a
|
||||||
</tr>
|
href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in"
|
||||||
</table>
|
>
|
||||||
</body>
|
<img
|
||||||
</html>
|
src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png"
|
||||||
|
alt="LinkedIn"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<p style="color: #555555">
|
||||||
|
copy right © 2024 CDC, all rights reserved
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 45 KiB |
|
@ -18,70 +18,133 @@
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
<link rel="shortcut icon" href="favicon.ico"/>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body, table, td, div, p, h1 {
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
}
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header, .email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body, .email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body class="email-wrapper">
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<table role="presentation" class="email-container">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" style="padding:0;">
|
<td>
|
||||||
<table role="presentation"
|
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
<div class="email-header">
|
||||||
<tr>
|
<img src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png" alt="CDC Logo" style="width: 35%; height: auto; display: block; margin: 0 auto;" />
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
</div>
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
<div class="inner-container">
|
||||||
style="height:auto;display:block;"/>
|
<div class="email-body">
|
||||||
</td>
|
<img src="https://cdc.iitdh.ac.in/storage/Images/notification.png" alt="verify Logo" style="width: 30%; height: auto; display: block; margin: 0 auto;" />
|
||||||
</tr>
|
<h2 style="text-align: center;">{{ opening_type }} Opportunity at {{ company_name }}</h2>
|
||||||
<tr>
|
<p style="text-align: center;">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
|
||||||
<table role="presentation"
|
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
|
||||||
<tr>
|
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
|
||||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
|
||||||
">{{ opening_type }} Opportunity at {{ company_name }}</h1>
|
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
|
||||||
Greetings of the day. Hope you are fine and doing well !
|
Greetings of the day. Hope you are fine and doing well !
|
||||||
</p>
|
|
||||||
<p style="text-indent: 4ch; margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
|
||||||
CDC is excited to announce that <b>{{ company_name }}</b> is interested in
|
CDC is excited to announce that <b>{{ company_name }}</b> is interested in
|
||||||
recruiting <b>{{ designation }}</b> from IIT Dharwad.
|
recruiting <b>{{ designation }}</b> from IIT Dharwad.
|
||||||
More details can be found in the CDC Web Portal.
|
More details can be found in the CDC Web Portal.
|
||||||
|
Interested students can apply before <b>{{ deadline }}</b> in the CDC-Web Portal</p>
|
||||||
|
<p style="text-align: center;">
|
||||||
|
<a
|
||||||
|
href="{{ link }}" style="display: inline-block; padding: 12px 24px; margin: 20px 0; font-size: 16px; color: #ffffff; background-color: #ff7350; text-decoration: none; border-radius: 50px; font-weight: 500;">CDC Web Portal</a>.
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
<div class="email-footer">
|
||||||
Interested students can apply before <b>{{ deadline }}</b> in the <a
|
<p style="margin-bottom: 16px; color: #555555;">Follow us on:</p>
|
||||||
href="{{ link }}">CDC-Web Portal</a>.
|
|
||||||
</p>
|
<a href="https://twitter.com/cdc_iitdh" style="margin-right: 10px; color: #eff7ff">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/twitter.png" alt="Twitter" style="width: 24px; height: 24px;">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.instagram.com/cdc.iitdh/?hl=en" style="margin-right: 10px; color: #eff7ff;">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png" alt="Instagram" style="width: 24px; height: 24px;">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png" alt="LinkedIn" style="width: 24px; height: 24px;">
|
||||||
|
</a>
|
||||||
|
<p style="color: #555555;">copy right © 2024 CDC, all rights reserved</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="padding:30px;background:#334878;">
|
|
||||||
<table role="presentation"
|
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
|
||||||
<tr>
|
|
||||||
<td style="padding:0;width:50%;" align="left">
|
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
|
||||||
® CDC,IIT Dharwad,2022<br/>
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -0,0 +1,206 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
|
<meta name="x-apple-disable-message-reformatting" />
|
||||||
|
<title></title>
|
||||||
|
<!--[if mso]>
|
||||||
|
<noscript>
|
||||||
|
<xml>
|
||||||
|
<o:OfficeDocumentSettings>
|
||||||
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||||
|
</o:OfficeDocumentSettings>
|
||||||
|
</xml>
|
||||||
|
</noscript>
|
||||||
|
<![endif]-->
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
<style>
|
||||||
|
body,
|
||||||
|
table,
|
||||||
|
td,
|
||||||
|
div,
|
||||||
|
p,
|
||||||
|
h1 {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header,
|
||||||
|
.email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body,
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="email-wrapper">
|
||||||
|
<table role="presentation" class="email-container">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class="email-header">
|
||||||
|
<img
|
||||||
|
src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png"
|
||||||
|
alt="CDC Logo"
|
||||||
|
style="width: 35%; height: auto; display: block; margin: 0 auto"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="inner-container">
|
||||||
|
<div class="email-body">
|
||||||
|
<img
|
||||||
|
src="https://cdc.iitdh.ac.in/storage/Images/tracking.png"
|
||||||
|
alt="verify Logo"
|
||||||
|
style="
|
||||||
|
width: 35%;
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<h1 style="text-align: center">Hello, Folks</h1>
|
||||||
|
<p style="text-align: center">
|
||||||
|
We have received a issue regarding a
|
||||||
|
<b>{{ application_type }}</b> opening at
|
||||||
|
<b> {{ company_name }}</b> From {{name}}. {% if
|
||||||
|
additional_info %} We received these additional details
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<!-- <table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
||||||
|
border-radius:15px; background-color: #e0e3ee"> -->
|
||||||
|
|
||||||
|
{% for i,j in additional_info.items %}
|
||||||
|
|
||||||
|
<!-- <tr>
|
||||||
|
<td style="padding:8px 10px;color:#153643; ">{{ i }}:</td>
|
||||||
|
<td style="padding:8px 10px;color:#153643;">{{ j }}</td>
|
||||||
|
</tr> -->
|
||||||
|
{% endfor %}
|
||||||
|
<!-- </table> -->
|
||||||
|
{% endif %} please look into it and take necessary actions.
|
||||||
|
get in touch with the student at
|
||||||
|
<nobr><u>{{ email }}</u></nobr>
|
||||||
|
|
||||||
|
<!-- </p> -->
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="email-footer">
|
||||||
|
<p style="margin-bottom: 16px; color: #555555">Follow us on:</p>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="https://twitter.com/cdc_iitdh"
|
||||||
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="https://cdc.iitdh.ac.in/storage/Images/twitter.png"
|
||||||
|
alt="Twitter"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://www.instagram.com/cdc.iitdh/?hl=en"
|
||||||
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png"
|
||||||
|
alt="Instagram"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png"
|
||||||
|
alt="LinkedIn"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<p style="color: #555555">
|
||||||
|
copy right © 2024 CDC, all rights reserved
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,86 +1,188 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="x-apple-disable-message-reformatting">
|
<meta name="x-apple-disable-message-reformatting" />
|
||||||
<title></title>
|
<title></title>
|
||||||
<!--[if mso]>
|
<!--[if mso]>
|
||||||
<noscript>
|
<noscript>
|
||||||
<xml>
|
<xml>
|
||||||
<o:OfficeDocumentSettings>
|
<o:OfficeDocumentSettings>
|
||||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||||
</o:OfficeDocumentSettings>
|
</o:OfficeDocumentSettings>
|
||||||
</xml>
|
</xml>
|
||||||
</noscript>
|
</noscript>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body,
|
||||||
font-family: 'Roboto', sans-serif;
|
table,
|
||||||
|
td,
|
||||||
|
div,
|
||||||
|
p,
|
||||||
|
h1 {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header,
|
||||||
|
.email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body,
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body>
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<div class="email-wrapper">
|
||||||
<tr>
|
<table role="presentation" class="email-container">
|
||||||
<td align="center" style="padding:0;">
|
<tr>
|
||||||
<table role="presentation"
|
<td>
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
<div class="email-header">
|
||||||
<tr>
|
<img
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png"
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
alt="CDC Logo"
|
||||||
style="height:auto;display:block;"/>
|
style="width: 35%; height: auto; display: block; margin: 0 auto"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="inner-container">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
<div class="email-body">
|
||||||
<table role="presentation"
|
<img
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
src="https://cdc.iitdh.ac.in/storage/Images/Rejected.png"
|
||||||
<tr>
|
alt="rejection Logo"
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
style="
|
||||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
width: 30%;
|
||||||
">Hey, {{ student_name }}</h1>
|
height: auto;
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
display: block;
|
||||||
We regret to inform you that you have not been selected for
|
margin: 0 auto;
|
||||||
<b>{{ designation }}</b> role at <b>{{ company_name }}</b>.
|
"
|
||||||
CDC will keep bringing more such opportunities for you in the future.
|
/>
|
||||||
</td>
|
<h2 style="text-align: center">Hey, {{ student_name }}</h2>
|
||||||
</tr>
|
<p style="text-align: center">
|
||||||
<tr>
|
We regret to inform you that you have not been selected for
|
||||||
<td style="padding:0;">
|
<b>{{ designation }}</b> role at <b>{{ company_name }}</b>.
|
||||||
<table role="presentation"
|
CDC will keep bringing more such opportunities for you in the
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
future.
|
||||||
<tr>
|
</p>
|
||||||
<td style="width:260px;padding:0;vertical-align:top;color:#334878;">
|
</div>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
<div class="email-footer">
|
||||||
</table>
|
<p style="margin-bottom: 16px; color: #555555">Follow us on:</p>
|
||||||
</td>
|
|
||||||
</tr>
|
<a
|
||||||
</table>
|
href="https://twitter.com/cdc_iitdh"
|
||||||
</td>
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
</tr>
|
>
|
||||||
<tr>
|
<img
|
||||||
<td style="padding:30px;background:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/twitter.png"
|
||||||
<table role="presentation"
|
alt="Twitter"
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
style="width: 24px; height: 24px"
|
||||||
<tr>
|
/>
|
||||||
<td style="padding:0;width:50%;" align="left">
|
</a>
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
<a
|
||||||
® CDC,IIT Dharwad,2021<br/>
|
href="https://www.instagram.com/cdc.iitdh/?hl=en"
|
||||||
</p>
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
</td>
|
>
|
||||||
</tr>
|
<img
|
||||||
</table>
|
src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png"
|
||||||
</td>
|
alt="Instagram"
|
||||||
</td>
|
style="width: 24px; height: 24px"
|
||||||
</tr>
|
/>
|
||||||
</table>
|
</a>
|
||||||
</td>
|
<a
|
||||||
</tr>
|
href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in"
|
||||||
</table>
|
>
|
||||||
</body>
|
<img
|
||||||
|
src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png"
|
||||||
|
alt="LinkedIn"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<p style="color: #555555">
|
||||||
|
copy right © 2024 CDC, all rights reserved
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,85 +1,186 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="x-apple-disable-message-reformatting">
|
<meta name="x-apple-disable-message-reformatting" />
|
||||||
<title></title>
|
<title></title>
|
||||||
<!--[if mso]>
|
<!--[if mso]>
|
||||||
<noscript>
|
<noscript>
|
||||||
<xml>
|
<xml>
|
||||||
<o:OfficeDocumentSettings>
|
<o:OfficeDocumentSettings>
|
||||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||||
</o:OfficeDocumentSettings>
|
</o:OfficeDocumentSettings>
|
||||||
</xml>
|
</xml>
|
||||||
</noscript>
|
</noscript>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body,
|
||||||
font-family: 'Roboto', sans-serif;
|
table,
|
||||||
|
td,
|
||||||
|
div,
|
||||||
|
p,
|
||||||
|
h1 {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header,
|
||||||
|
.email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body,
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body>
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<div class="email-wrapper">
|
||||||
<tr>
|
<table role="presentation" class="email-container">
|
||||||
<td align="center" style="padding:0;">
|
<tr>
|
||||||
<table role="presentation"
|
<td>
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
<div class="email-header">
|
||||||
<tr>
|
<img
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png"
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
alt="CDC Logo"
|
||||||
style="height:auto;display:block;"/>
|
style="width: 35%; height: auto; display: block; margin: 0 auto"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="inner-container">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
<div class="email-body">
|
||||||
<table role="presentation"
|
<img
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
src="https://cdc.iitdh.ac.in/storage/Images/Confirmed.png"
|
||||||
<tr>
|
alt="approved Logo"
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
style="
|
||||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
width: 30%;
|
||||||
">Hey, {{ student_name }}</h1>
|
height: auto;
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
display: block;
|
||||||
Congratulations, You have been selected for the <b>{{ designation }}</b> at
|
margin: 0 auto;
|
||||||
<b>{{ company_name }}</b>.<br>
|
"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
<h2 style="text-align: center">Hey, {{ student_name }}</h2>
|
||||||
<tr>
|
<p style="text-align: center">
|
||||||
<td style="padding:0;">
|
Congratulations, You have been selected for the
|
||||||
<table role="presentation"
|
<b>{{ designation }}</b> at <b>{{ company_name }}</b>.<br />
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
</p>
|
||||||
<tr>
|
</div>
|
||||||
<td style="width:260px;padding:0;vertical-align:top;color:#334878;">
|
</div>
|
||||||
</td>
|
<div class="email-footer">
|
||||||
</tr>
|
<p style="margin-bottom: 16px; color: #555555">Follow us on:</p>
|
||||||
</table>
|
|
||||||
</td>
|
<a
|
||||||
</tr>
|
href="https://twitter.com/cdc_iitdh"
|
||||||
</table>
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
</td>
|
>
|
||||||
</tr>
|
<img
|
||||||
<tr>
|
src="https://cdc.iitdh.ac.in/storage/Images/twitter.png"
|
||||||
<td style="padding:30px;background:#334878;">
|
alt="Twitter"
|
||||||
<table role="presentation"
|
style="width: 24px; height: 24px"
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
/>
|
||||||
<tr>
|
</a>
|
||||||
<td style="padding:0;width:50%;" align="left">
|
<a
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
href="https://www.instagram.com/cdc.iitdh/?hl=en"
|
||||||
® CDC,IIT Dharwad,2021<br/>
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
</p>
|
>
|
||||||
</td>
|
<img
|
||||||
</tr>
|
src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png"
|
||||||
</table>
|
alt="Instagram"
|
||||||
</td>
|
style="width: 24px; height: 24px"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</a>
|
||||||
</table>
|
<a
|
||||||
</td>
|
href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in"
|
||||||
</tr>
|
>
|
||||||
</table>
|
<img
|
||||||
</body>
|
src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png"
|
||||||
|
alt="LinkedIn"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<p style="color: #555555">
|
||||||
|
copy right © 2024 CDC, all rights reserved
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,118 +1,204 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="x-apple-disable-message-reformatting">
|
<meta name="x-apple-disable-message-reformatting" />
|
||||||
<title></title>
|
<title></title>
|
||||||
<!--[if mso]>
|
<!--[if mso]>
|
||||||
<noscript>
|
<noscript>
|
||||||
<xml>
|
<xml>
|
||||||
<o:OfficeDocumentSettings>
|
<o:OfficeDocumentSettings>
|
||||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||||
</o:OfficeDocumentSettings>
|
</o:OfficeDocumentSettings>
|
||||||
</xml>
|
</xml>
|
||||||
</noscript>
|
</noscript>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body,
|
||||||
font-family: 'Roboto', sans-serif;
|
table,
|
||||||
|
td,
|
||||||
|
div,
|
||||||
|
p,
|
||||||
|
h1 {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header,
|
||||||
|
.email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body,
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body>
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<div class="email-wrapper">
|
||||||
<tr>
|
<table role="presentation" class="email-container">
|
||||||
<td align="center" style="padding:0;">
|
<tr>
|
||||||
<table role="presentation"
|
<td>
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
<div class="email-header">
|
||||||
<tr>
|
<img
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png"
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
alt="CDC Logo"
|
||||||
style="height:auto;display:block;"/>
|
style="width: 35%; height: auto; display: block; margin: 0 auto"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="inner-container">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
<div class="email-body">
|
||||||
<table role="presentation"
|
<img
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
src="https://cdc.iitdh.ac.in/storage/Images/message.png"
|
||||||
<tr>
|
alt="verify Logo"
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
style="
|
||||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
width: 35%;
|
||||||
">Hello, {{ name }}</h1>
|
height: auto;
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
display: block;
|
||||||
We have received your application for a <b>{{ application_type }}</b> offer at
|
margin: 0 auto;
|
||||||
<b>
|
"
|
||||||
{{ company_name }}</b>.
|
/>
|
||||||
{% if additional_info_items %}
|
<h2 style="text-align: center">Hello, {{ name }}</h2>
|
||||||
We received these additional details
|
<p style="text-align: center">
|
||||||
<br>
|
We have received your application for a
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family:
|
<b>{{ application_type }}</b> offer at
|
||||||
'Roboto', sans-serif;text-align: center">
|
<b> {{ company_name }}</b>. {% if additional_info_items %} We
|
||||||
|
received these additional details
|
||||||
|
<br />
|
||||||
|
|
||||||
<table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
<!-- <table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
||||||
border-radius:15px; background-color: #e0e3ee">
|
border-radius:15px; background-color: #e0e3ee"> -->
|
||||||
|
|
||||||
{% for i,j in additional_info.items %}
|
{% for i,j in additional_info.items %}
|
||||||
|
|
||||||
<tr>
|
<!-- <tr> -->
|
||||||
<td style="padding:8px 10px;color:#153643; ">{{ i }}:</td>
|
<!-- <td style="padding:8px 10px;color:#153643; ">{{ i }}:</td> -->
|
||||||
<td style="padding:8px 10px;color:#153643;">{{ j }}</td>
|
<!-- <td style="padding:8px 10px;color:#153643;">{{ j }}</td> -->
|
||||||
</tr>
|
<!-- </tr> -->
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
<!-- </table> -->
|
||||||
{% endif %}
|
{% endif %} We will keep you informed with the updates. If you
|
||||||
|
have any queries, please feel to write to
|
||||||
|
<nobr><u>cdc.support@iitdh.ac.in</u></nobr>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="email-footer">
|
||||||
|
<p style="margin-bottom: 16px; color: #555555">Follow us on:</p>
|
||||||
|
|
||||||
</p>
|
<a
|
||||||
</p>
|
href="https://twitter.com/cdc_iitdh"
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
We will keep you informed with the updates. If you have any queries, please
|
>
|
||||||
feel to
|
<img
|
||||||
write to
|
src="https://cdc.iitdh.ac.in/storage/Images/twitter.png"
|
||||||
<nobr><u>cdc.support@iitdh.ac.in</u></nobr>
|
alt="Twitter"
|
||||||
</p>
|
style="width: 24px; height: 24px"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</a>
|
||||||
<tr>
|
<a
|
||||||
<td style="padding:0;">
|
href="https://www.instagram.com/cdc.iitdh/?hl=en"
|
||||||
<table role="presentation"
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
>
|
||||||
<tr>
|
<img
|
||||||
<td style="width:260px;padding:0;vertical-align:top;color:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png"
|
||||||
|
alt="Instagram"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</a>
|
||||||
</table>
|
<a
|
||||||
</td>
|
href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in"
|
||||||
</tr>
|
>
|
||||||
</table>
|
<img
|
||||||
</td>
|
src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png"
|
||||||
</tr>
|
alt="LinkedIn"
|
||||||
<tr>
|
style="width: 24px; height: 24px"
|
||||||
<td style="padding:30px;background:#334878;">
|
/>
|
||||||
<table role="presentation"
|
</a>
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
<p style="color: #555555">
|
||||||
<tr>
|
copy right © 2024 CDC, all rights reserved
|
||||||
<td style="padding:0;width:50%;" align="left">
|
</p>
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
</div>
|
||||||
® CDC,IIT Dharwad,2021<br/>
|
</td>
|
||||||
</p>
|
</tr>
|
||||||
</td>
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</td>
|
</html>
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,124 +1,212 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="x-apple-disable-message-reformatting">
|
<meta name="x-apple-disable-message-reformatting" />
|
||||||
<title></title>
|
<title></title>
|
||||||
<!--[if mso]>
|
<!--[if mso]>
|
||||||
<noscript>
|
<noscript>
|
||||||
<xml>
|
<xml>
|
||||||
<o:OfficeDocumentSettings>
|
<o:OfficeDocumentSettings>
|
||||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||||
</o:OfficeDocumentSettings>
|
</o:OfficeDocumentSettings>
|
||||||
</xml>
|
</xml>
|
||||||
</noscript>
|
</noscript>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body,
|
||||||
font-family: 'Roboto', sans-serif;
|
table,
|
||||||
|
td,
|
||||||
|
div,
|
||||||
|
p,
|
||||||
|
h1 {
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header,
|
||||||
|
.email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body,
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body>
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<div class="email-wrapper">
|
||||||
<tr>
|
<table role="presentation" class="email-container">
|
||||||
<td align="center" style="padding:0;">
|
<tr>
|
||||||
<table role="presentation"
|
<td>
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
<div class="email-header">
|
||||||
<tr>
|
<img
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png"
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
alt="CDC Logo"
|
||||||
style="height:auto;display:block;"/>
|
style="width: 35%; height: auto; display: block; margin: 0 auto"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="inner-container">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
<div class="email-body">
|
||||||
<table role="presentation"
|
<img
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
src="https://cdc.iitdh.ac.in/storage/Images/mobile.png"
|
||||||
<tr>
|
alt="verify Logo"
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
style="
|
||||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
width: 35%;
|
||||||
">Hello, {{ name }}</h1>
|
height: auto;
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
display: block;
|
||||||
We have received some update in your application for a <b>{{ application_type }}</b> offer at
|
margin: 0 auto;
|
||||||
<b>
|
"
|
||||||
{{ company_name }}</b>.
|
/>
|
||||||
<table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
<h2 style="text-align: center">Hello, {{ name }}</h2>
|
||||||
border-radius:15px; background-color: #e0e3ee">
|
<p style="text-align: center">
|
||||||
<tr>
|
We have received some update in your application for a
|
||||||
<td style="padding:8px 10px;color:#153643; "> resume:</td>
|
<b>{{ application_type }}</b> offer at
|
||||||
<td style="padding:8px 10px;color:#153643;">{{ resume }}</td>
|
<b> {{ company_name }}</b>.
|
||||||
</tr>
|
<!-- <table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
||||||
</table>
|
border-radius:15px; background-color: #e0e3ee">
|
||||||
|
<tr>
|
||||||
|
<td style="padding:8px 10px;color:#153643; "> resume:</td>
|
||||||
|
<td style="padding:8px 10px;color:#153643;">{{ resume }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
-->
|
||||||
|
<!-- {% if additional_info_items %} -->
|
||||||
|
<!-- We received these additional details -->
|
||||||
|
<!-- <br> -->
|
||||||
|
<!-- <p style="text-align: center;"> -->
|
||||||
|
<!-- {% for i,j in additional_info_items.items %} -->
|
||||||
|
|
||||||
{% if additional_info_items %}
|
<!-- <tr>
|
||||||
We received these additional details
|
<td style="padding:8px 10px;color:#153643; ">{{ i }}:</td>
|
||||||
<br>
|
<td style="padding:8px 10px;color:#153643;">{{ j }}</td>
|
||||||
<table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
</tr> -->
|
||||||
border-radius:15px; background-color: #e0e3ee">
|
<!-- {% endfor %} -->
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family:
|
<!-- </table> -->
|
||||||
'Roboto', sans-serif;text-align: center">
|
<!-- {% endif %} -->
|
||||||
{% for i,j in additional_info_items.items %}
|
|
||||||
|
|
||||||
<tr>
|
We will keep you informed with the updates. If you have any
|
||||||
<td style="padding:8px 10px;color:#153643; ">{{ i }}:</td>
|
queries, please feel to write to
|
||||||
<td style="padding:8px 10px;color:#153643;">{{ j }}</td>
|
<nobr><u>cdc.support@iitdh.ac.in</u></nobr>
|
||||||
</tr>
|
</p>
|
||||||
{% endfor %}
|
</div>
|
||||||
</table>
|
</div>
|
||||||
{% endif %}
|
<div class="email-footer">
|
||||||
|
<p style="margin-bottom: 16px; color: #555555">Follow us on:</p>
|
||||||
|
|
||||||
</p>
|
<a
|
||||||
</p>
|
href="https://twitter.com/cdc_iitdh"
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
We will keep you informed with the updates. If you have any queries, please
|
>
|
||||||
feel to
|
<img
|
||||||
write to
|
src="https://cdc.iitdh.ac.in/storage/Images/twitter.png"
|
||||||
<nobr><u>cdc.support@iitdh.ac.in</u></nobr>
|
alt="Twitter"
|
||||||
</p>
|
style="width: 24px; height: 24px"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</a>
|
||||||
<tr>
|
<a
|
||||||
<td style="padding:0;">
|
href="https://www.instagram.com/cdc.iitdh/?hl=en"
|
||||||
<table role="presentation"
|
style="margin-right: 10px; color: #eff7ff"
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
>
|
||||||
<tr>
|
<img
|
||||||
<td style="width:260px;padding:0;vertical-align:top;color:#334878;">
|
src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png"
|
||||||
|
alt="Instagram"
|
||||||
|
style="width: 24px; height: 24px"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</a>
|
||||||
</table>
|
<a
|
||||||
</td>
|
href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in"
|
||||||
</tr>
|
>
|
||||||
</table>
|
<img
|
||||||
</td>
|
src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png"
|
||||||
</tr>
|
alt="LinkedIn"
|
||||||
<tr>
|
style="width: 24px; height: 24px"
|
||||||
<td style="padding:30px;background:#334878;">
|
/>
|
||||||
<table role="presentation"
|
</a>
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
<p style="color: #555555">
|
||||||
<tr>
|
copy right © 2024 CDC, all rights reserved
|
||||||
<td style="padding:0;width:50%;" align="left">
|
</p>
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
</div>
|
||||||
® CDC,IIT Dharwad,2021<br/>
|
</td>
|
||||||
</p>
|
</tr>
|
||||||
</td>
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</td>
|
</html>
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -0,0 +1,162 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta name="x-apple-disable-message-reformatting">
|
||||||
|
<title></title>
|
||||||
|
<!--[if mso]>
|
||||||
|
<noscript>
|
||||||
|
<xml>
|
||||||
|
<o:OfficeDocumentSettings>
|
||||||
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||||
|
</o:OfficeDocumentSettings>
|
||||||
|
</xml>
|
||||||
|
</noscript>
|
||||||
|
<![endif]-->
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"/>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
body, table, td, div, p, h1 {
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header, .email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h2 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body, .email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="email-wrapper">
|
||||||
|
<table role="presentation" class="email-container">
|
||||||
|
<tr>
|
||||||
|
<td >
|
||||||
|
<div class="email-header">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png" alt="CDC Logo" style="width: 35%; height: auto; display: block; margin: 0 auto;" />
|
||||||
|
</div>
|
||||||
|
<div class="inner-container">
|
||||||
|
<div class="email-body">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/tracking.png" alt="verify Logo" style="width: 35%; height: auto; display: block; margin: 0 auto;" />
|
||||||
|
<h2 style="text-align: center;"
|
||||||
|
>Hello, {{ name }}</h1>
|
||||||
|
<p style="text-align:center;">
|
||||||
|
We have received your issue regarding a <b>{{ application_type }}</b> opening at
|
||||||
|
<b>
|
||||||
|
{{ company_name }}</b>.
|
||||||
|
{% if additional_info %}
|
||||||
|
We received these additional details
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<!-- <table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
||||||
|
border-radius:15px; background-color: #e0e3ee"> -->
|
||||||
|
|
||||||
|
{% for i,j in additional_info.items %}
|
||||||
|
|
||||||
|
<!-- <tr>
|
||||||
|
<td style="padding:8px 10px;color:#153643; ">{{ i }}:</td>
|
||||||
|
<td style="padding:8px 10px;color:#153643;">{{ j }}</td>
|
||||||
|
</tr> -->
|
||||||
|
{% endfor %}
|
||||||
|
<!-- </table> -->
|
||||||
|
{% endif %}
|
||||||
|
We will get back to you if we find it legitimate. If you have any queries, please
|
||||||
|
feel to
|
||||||
|
write to
|
||||||
|
<nobr><u>cdc.support@iitdh.ac.in</u></nobr>
|
||||||
|
</p></div></div>
|
||||||
|
<div class="email-footer">
|
||||||
|
<p style="margin-bottom: 16px; color: #555555;">Follow us on:</p>
|
||||||
|
|
||||||
|
<a href="https://twitter.com/cdc_iitdh" style="margin-right: 10px; color: #eff7ff">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/twitter.png" alt="Twitter" style="width: 24px; height: 24px;">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.instagram.com/cdc.iitdh/?hl=en" style="margin-right: 10px; color: #eff7ff;">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png" alt="Instagram" style="width: 24px; height: 24px;">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in">
|
||||||
|
<img src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png" alt="LinkedIn" style="width: 24px; height: 24px;">
|
||||||
|
</a>
|
||||||
|
<p style="color: #555555;">copy right © 2024 CDC, all rights reserved</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -18,60 +18,128 @@
|
||||||
<link rel="shortcut icon" href="favicon.ico"/>
|
<link rel="shortcut icon" href="favicon.ico"/>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
table, td, div, h1, p {
|
body, table, td, div, p, h1 {
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
}
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-wrapper {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e1e4e8; /* Outer background color */
|
||||||
|
}
|
||||||
|
.email-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #eff7ff; /* Outer box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.email-header, .email-footer {
|
||||||
|
padding: 40px 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-header img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.email-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container {
|
||||||
|
background-color: #ffffff; /* Inner box background color */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body {
|
||||||
|
padding: 36px 30px;
|
||||||
|
}
|
||||||
|
.inner-container .email-body h4 {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.inner-container .email-body p {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
.email-footer {
|
||||||
|
padding: 20px 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.email-footer p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff7350;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.inner-container .email-body, .email-footer {
|
||||||
|
padding: 20px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0;padding:0;">
|
<body>
|
||||||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
|
<div class="email-wrapper">
|
||||||
<tr>
|
<table role="presentation" class="email-container">
|
||||||
<td align="center" style="padding:0;">
|
|
||||||
<table role="presentation"
|
|
||||||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
<td>
|
||||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
<div class="email-header">
|
||||||
style="height:auto;display:block;"/>
|
<img src="https://cdc.iitdh.ac.in/storage/Images/CDC-Logo.png" alt="CDC Logo" style="width: 35%; height: auto; display: block; margin: 0 auto;" />
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
<div class="inner-container">
|
||||||
<tr>
|
<div class="email-body">
|
||||||
<td style="padding:36px 30px 42px 30px;">
|
<img src="https://cdc.iitdh.ac.in/storage/Images/reminder.png" alt="verify Logo" style="width: 25%; height: auto; display: block; margin: 0 auto;" />
|
||||||
<table role="presentation"
|
<h4 style="text-align: center;">{{ opening_type }} Opportunity at {{ company_name }}</h3>
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
|
<p style="text-align: center;">
|
||||||
<tr>
|
|
||||||
<td style="padding:0 0 36px 0;color:#153643;">
|
|
||||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
|
||||||
">{{ opening_type }} Opportunity at {{ company_name }}</h1>
|
|
||||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
|
||||||
Gentle reminder to fill out the application form.
|
Gentle reminder to fill out the application form.
|
||||||
Interested students can apply before <b>{{ deadline }}</b> in the <a
|
Interested students can apply before <b>{{ deadline }}</b> in the CDC-webportal</p>
|
||||||
href="{{ link }}">CDC-webportal</a>.
|
<p style="text-align: center;"> <a
|
||||||
|
href="{{ link }}" style="display: inline-block; padding: 12px 24px; margin: 20px 0; font-size: 16px; color: #ffffff; background-color: #ff7350; text-decoration: none; border-radius: 50px; font-weight: 500;">CDC web portal</a>.
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</div></div>
|
||||||
</tr>
|
|
||||||
|
<div class="email-footer">
|
||||||
</table>
|
<p style="margin-bottom: 16px; color: #555555;">Follow us on:</p>
|
||||||
</td>
|
|
||||||
</tr>
|
<a href="https://twitter.com/cdc_iitdh" style="margin-right: 10px; color: #eff7ff">
|
||||||
<tr>
|
<img src="https://cdc.iitdh.ac.in/storage/Images/twitter.png" alt="Twitter" style="width: 24px; height: 24px;">
|
||||||
<td style="padding:30px;background:#334878;">
|
</a>
|
||||||
<table role="presentation"
|
<a href="https://www.instagram.com/cdc.iitdh/?hl=en" style="margin-right: 10px; color: #eff7ff;">
|
||||||
style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family: 'Roboto', sans-serif;">
|
<img src="https://cdc.iitdh.ac.in/storage/Images/Instagram_icon.png" alt="Instagram" style="width: 24px; height: 24px;">
|
||||||
<tr>
|
</a>
|
||||||
<td style="padding:0;width:50%;" align="left">
|
<a href="https://www.linkedin.com/company/cdciitdharwad/?originalSubdomain=in">
|
||||||
<p style="margin:0;font-size:14px;line-height:16px;font-family: 'Roboto', sans-serif;color:#ffffff;">
|
<img src="https://cdc.iitdh.ac.in/storage/Images/LinkedIn_logo_initials.png" alt="LinkedIn" style="width: 24px; height: 24px;">
|
||||||
® CDC,IIT Dharwad,2022<br/>
|
</a>
|
||||||
</p>
|
<p style="color: #555555;">copy right © 2024 CDC, all rights reserved</p>
|
||||||
</td>
|
|
||||||
</tr>
|
</div>
|
||||||
</table>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,7 +1,7 @@
|
||||||
asgiref==3.5.0
|
asgiref>=3.5.2,<4
|
||||||
astroid==2.11.2
|
astroid==2.11.2
|
||||||
cachetools==5.0.0
|
cachetools==5.0.0
|
||||||
certifi==2021.10.8
|
certifi==2022.12.7
|
||||||
chardet==4.0.0
|
chardet==4.0.0
|
||||||
charset-normalizer==2.0.12
|
charset-normalizer==2.0.12
|
||||||
colorama==0.4.4
|
colorama==0.4.4
|
||||||
|
@ -13,11 +13,13 @@ Django==3.2.13
|
||||||
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-crontab==0.7.1
|
||||||
django-db-logger==0.1.12
|
django-db-logger==0.1.12
|
||||||
django-extensions==3.2.1
|
django-extensions==3.2.1
|
||||||
django-import-export==2.8.0
|
django-import-export==2.8.0
|
||||||
django-simple-history==3.1.1
|
django-simple-history==3.1.1
|
||||||
djangorestframework==3.13.1
|
djangorestframework==3.13.1
|
||||||
|
daphne==4.1.0
|
||||||
et-xmlfile==1.1.0
|
et-xmlfile==1.1.0
|
||||||
google-auth==2.6.6
|
google-auth==2.6.6
|
||||||
gunicorn==20.1.0
|
gunicorn==20.1.0
|
||||||
|
|
4
setup.sh
4
setup.sh
|
@ -3,12 +3,12 @@ echo "Environment setup complete"
|
||||||
cd CDC_Backend
|
cd CDC_Backend
|
||||||
|
|
||||||
python3 manage.py flush --no-input
|
python3 manage.py flush --no-input
|
||||||
python3 manage.py makemigrations
|
python3 manage.py makemigrations APIs
|
||||||
python3 manage.py migrate
|
python3 manage.py migrate
|
||||||
echo "Migrations complete"
|
echo "Migrations complete"
|
||||||
|
|
||||||
python3 manage.py collectstatic --noinput
|
python3 manage.py collectstatic --noinput
|
||||||
|
python3 manage.py crontab add
|
||||||
DIR="./Storage"
|
DIR="./Storage"
|
||||||
if [ -d "$DIR" ]; then
|
if [ -d "$DIR" ]; then
|
||||||
### Take action if $DIR exists ###
|
### Take action if $DIR exists ###
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /home/cdc/Desktop/CDC_Web_Portal_Backend/cdc-placement-website-backend/venv/bin/activate
|
||||||
|
|
||||||
|
cd /home/cdc/Desktop/CDC_Web_Portal_Backend/cdc-placement-website-backend/CDC_Backend
|
||||||
|
|
||||||
|
bash run_prod.sh
|
|
@ -4,4 +4,4 @@ source /home/cdc/Desktop/CDC_Web_Portal_Backend/cdc-placement-website-backend/ve
|
||||||
|
|
||||||
cd /home/cdc/Desktop/CDC_Web_Portal_Backend/cdc-placement-website-backend/CDC_Backend
|
cd /home/cdc/Desktop/CDC_Web_Portal_Backend/cdc-placement-website-backend/CDC_Backend
|
||||||
|
|
||||||
python manage.py process_tasks
|
python3 manage.py process_tasks
|
||||||
|
|
Loading…
Reference in New Issue