Reformatted Code and Optimized Imports

This commit is contained in:
gowtham 2022-05-02 17:16:56 +05:30
parent 4e6f3c6b8d
commit c270e5b5b6
25 changed files with 206 additions and 150 deletions

View File

@ -1,17 +1,14 @@
from django.contrib import admin from django.contrib import admin
from .models import *
from django.contrib import admin
from django.contrib.admin.templatetags.admin_urls import admin_urlname from django.contrib.admin.templatetags.admin_urls import admin_urlname
from django.shortcuts import resolve_url from django.shortcuts import resolve_url
from django.utils.html import format_html from django.utils.html import format_html
from django.utils.safestring import SafeText from django.utils.safestring import SafeText
from .models import * from .models import *
admin.site.register(User) admin.site.register(User)
admin.site.register(Admin) admin.site.register(Admin)
admin.site.site_header = "CDC Recruitment Portal" admin.site.site_header = "CDC Recruitment Portal"
@ -22,10 +19,21 @@ def model_admin_url(obj, name=None) -> str:
@admin.register(Student) @admin.register(Student)
class Student(admin.ModelAdmin): class Student(admin.ModelAdmin):
list_display = ("roll_no", "name", "batch", "branch", "phone_number") list_display = ("roll_no", "name", "batch", "branch", "phone_number", 'can_apply')
search_fields = ("roll_no", "name","phone_number") search_fields = ("roll_no", "name", "phone_number")
ordering = ("roll_no", "name", "batch", "branch", "phone_number") ordering = ("roll_no", "name", "batch", "branch", "phone_number")
list_filter = ("batch", "branch") list_filter = ("batch", "branch")
actions = ['mark_can_apply_as_no', 'mark_can_apply_as_yes']
@admin.action(description="Deregister students")
def mark_can_apply_as_no(self, request, queryset):
queryset.update(can_apply=False)
self.message_user(request, "Deregistered the users")
@admin.action(description="Register students")
def mark_can_apply_as_yes(self, request, queryset):
queryset.update(can_apply=True)
self.message_user(request, "Registered the users")
@admin.register(Placement) @admin.register(Placement)
@ -59,4 +67,3 @@ class PrePlacementOffer(admin.ModelAdmin):
def Student(self, obj): def Student(self, obj):
return model_admin_url(obj.student) return model_admin_url(obj.student)

View File

@ -1,6 +1,6 @@
from django.urls import path from django.urls import path
from . import adminViews
from . import adminViews
urlpatterns = [ urlpatterns = [
path('markStatus/', adminViews.markStatus, name="Mark Status"), path('markStatus/', adminViews.markStatus, name="Mark Status"),

View File

@ -1,5 +1,4 @@
import csv import csv
import json
from rest_framework.decorators import api_view from rest_framework.decorators import api_view
@ -306,6 +305,7 @@ def generateCSV(request, id, email, user_type):
return Response({'action': "Create csv", 'message': "Error Occurred"}, return Response({'action': "Create csv", 'message': "Error Occurred"},
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=[COMPANY_NAME, COMPENSATION_GROSS, OFFER_ACCEPTED, STUDENT_ID, DESIGNATION, TIER]) @precheck(required_data=[COMPANY_NAME, COMPENSATION_GROSS, OFFER_ACCEPTED, STUDENT_ID, DESIGNATION, TIER])

View File

@ -1,6 +1,6 @@
from django.urls import path from django.urls import path
from . import companyViews
from . import companyViews
urlpatterns = [ urlpatterns = [
path('addPlacement/', companyViews.addPlacement, name="Add Placement"), path('addPlacement/', companyViews.addPlacement, name="Add Placement"),

View File

@ -1,7 +1,5 @@
from rest_framework.decorators import api_view from rest_framework.decorators import api_view
from django.forms.models import model_to_dict
from .models import *
from .utils import * from .utils import *
logger = logging.getLogger('db') logger = logging.getLogger('db')

View File

@ -56,7 +56,6 @@ FOURTH_YEAR = '2019'
MAX_OFFERS_PER_STUDENT = 2 MAX_OFFERS_PER_STUDENT = 2
EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours
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/'
@ -88,7 +87,6 @@ STATE = 'state'
COUNTRY = 'country' COUNTRY = 'country'
PINCODE = 'pincode' PINCODE = 'pincode'
DESIGNATION = 'designation' DESIGNATION = 'designation'
DESCRIPTION = 'description' DESCRIPTION = 'description'
DESCRIPTION_PDF = 'description_pdf' DESCRIPTION_PDF = 'description_pdf'
@ -123,7 +121,6 @@ STUDENT_LIST = "student_list"
STUDENT_ID = "student_id" STUDENT_ID = "student_id"
STUDENT_SELECTED = "student_selected" STUDENT_SELECTED = "student_selected"
COMPANY_OPENING_SUBMITTED_TEMPLATE_SUBJECT = "Notification Submitted - {id} - Career Development Cell, IIT Dharwad" 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_STATUS_TEMPLATE_SUBJECT = 'Application Status : {company_name} - {id}'
STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT = 'CDC - Application Submitted - {company_name}' STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT = 'CDC - Application Submitted - {company_name}'

View File

@ -1,15 +1,18 @@
from django.contrib.postgres.fields import ArrayField from django.contrib.postgres.fields import ArrayField
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
from .constants import *
# from .utils import *
from .constants import *
# from .utils import *
class User(models.Model): class User(models.Model):
email = models.CharField(primary_key=True, blank=False, max_length=50) email = models.CharField(primary_key=True, blank=False, max_length=50)
id = models.CharField(blank=False, max_length=25) id = models.CharField(blank=False, max_length=25)
user_type = ArrayField(models.CharField(blank=False, max_length=10), size=4, default=list, blank=False) user_type = ArrayField(models.CharField(blank=False, max_length=10), size=4, default=list, blank=False)
last_login_time = models.DateTimeField(default=timezone.now)
class Student(models.Model): class Student(models.Model):
@ -21,7 +24,7 @@ class Student(models.Model):
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=100), size=10, default=list, blank=True) resumes = ArrayField(models.CharField(null=True, default=None, max_length=100), size=10, 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) can_apply = models.BooleanField(default=True, verbose_name='Registered')
def __str__(self): def __str__(self):
return str(self.roll_no) return str(self.roll_no)
@ -45,7 +48,8 @@ class Placement(models.Model):
nature_of_business = models.CharField(blank=False, max_length=50, default="") nature_of_business = models.CharField(blank=False, max_length=50, default="")
website = models.CharField(blank=True, max_length=50) website = models.CharField(blank=True, max_length=50)
company_details = models.CharField(max_length=500, default=None, null=True) company_details = models.CharField(max_length=500, default=None, null=True)
company_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True) company_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5,
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=50) contact_person_name = models.CharField(blank=False, max_length=50)
phone_number = models.PositiveBigIntegerField(blank=False) phone_number = models.PositiveBigIntegerField(blank=False)
@ -53,24 +57,28 @@ class Placement(models.Model):
city = models.CharField(blank=False, max_length=100, default="") city = models.CharField(blank=False, max_length=100, default="")
state = models.CharField(blank=False, max_length=100, default="") state = models.CharField(blank=False, max_length=100, default="")
country = models.CharField(blank=False, max_length=100, default="") country = models.CharField(blank=False, max_length=100, 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)
# Job Details # Job Details
designation = models.CharField(blank=False, max_length=50, default=None, null=True) designation = models.CharField(blank=False, max_length=50, default=None, null=True)
description = models.CharField(blank=False, max_length=500, default=None, null=True) description = models.CharField(blank=False, max_length=500, default=None, null=True)
description_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True) description_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list,
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
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)
compensation_details = models.CharField(blank=True, max_length=500, default=None, null=True) compensation_details = models.CharField(blank=True, max_length=500, default=None, null=True)
compensation_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True) compensation_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5,
default=list, blank=True)
is_compensation_details_pdf = models.BooleanField(blank=False, default=False) is_compensation_details_pdf = models.BooleanField(blank=False, default=False)
bond_details = models.CharField(blank=True, max_length=500) bond_details = models.CharField(blank=True, max_length=500)
selection_procedure_rounds = ArrayField(models.CharField(null=True, default=None, max_length=100), size=10, default=list, blank=True) selection_procedure_rounds = ArrayField(models.CharField(null=True, default=None, max_length=100), size=10,
default=list, blank=True)
selection_procedure_details = models.CharField(blank=True, max_length=500) selection_procedure_details = models.CharField(blank=True, max_length=500)
selection_procedure_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True) selection_procedure_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100),
size=5, default=list, blank=True)
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)
@ -103,6 +111,7 @@ class Placement(models.Model):
def __str__(self): def __str__(self):
return self.company_name + " - " + self.id return self.company_name + " - " + self.id
class PlacementApplication(models.Model): class PlacementApplication(models.Model):
id = models.CharField(blank=False, primary_key=True, max_length=15) id = models.CharField(blank=False, primary_key=True, max_length=15)
placement = models.ForeignKey(Placement, blank=False, on_delete=models.RESTRICT, default=None, null=True) placement = models.ForeignKey(Placement, blank=False, on_delete=models.RESTRICT, default=None, null=True)

View File

@ -1,6 +1,7 @@
import urllib import urllib
from rest_framework import serializers from rest_framework import serializers
from .models import * from .models import *

View File

@ -1,6 +1,6 @@
from django.urls import path, include 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"),

View File

@ -1,8 +1,3 @@
import json
# from datetime import datetime
import datetime
import traceback
from rest_framework.decorators import api_view from rest_framework.decorators import api_view
from .serializers import * from .serializers import *

View File

@ -1,3 +1 @@
from django.test import TestCase
# Create your tests here. # Create your tests here.

View File

@ -1,4 +1,5 @@
from django.urls import path, include from django.urls import path, include
from . import studentViews, studentUrls, companyUrls, adminUrls from . import studentViews, studentUrls, companyUrls, adminUrls
urlpatterns = [ urlpatterns = [

View File

@ -1,4 +1,5 @@
import datetime import datetime
import json
import logging import logging
import os import os
import random import random
@ -7,9 +8,11 @@ import string
import sys import sys
import traceback import traceback
from os import path, remove from os import path, remove
import json
import background_task import background_task
import jwt import jwt
import pdfkit
import requests as rq
from django.conf import settings from django.conf import settings
from django.core.mail import EmailMultiAlternatives from django.core.mail import EmailMultiAlternatives
from django.forms.models import model_to_dict from django.forms.models import model_to_dict
@ -21,8 +24,6 @@ from google.auth.transport import requests
from google.oauth2 import id_token from google.oauth2 import id_token
from rest_framework import status from rest_framework import status
from rest_framework.response import Response from rest_framework.response import Response
import requests as rq
import pdfkit
from .constants import * from .constants import *
from .models import User, PrePlacementOffer, PlacementApplication, Placement from .models import User, PrePlacementOffer, PlacementApplication, Placement
@ -78,7 +79,8 @@ def isAuthorized(allowed_users=None):
print(email) print(email)
user = get_object_or_404(User, email=email) user = get_object_or_404(User, email=email)
if user: if user:
user.last_login_time = datetime.datetime.now()
user.save()
if len(set(user.user_type).intersection(set(allowed_users))) or allowed_users == '*': if len(set(user.user_type).intersection(set(allowed_users))) or allowed_users == '*':
return view_func(request, user.id, user.email, user.user_type, *args, **kwargs) return view_func(request, user.id, user.email, user.user_type, *args, **kwargs)
else: else:
@ -150,7 +152,8 @@ def sendEmail(email_to, subject, data, template, attachment_jnf_respone=None):
msg.attach_alternative(html_content, "text/html") msg.attach_alternative(html_content, "text/html")
if attachment_jnf_respone: if attachment_jnf_respone:
logger.info(attachment_jnf_respone) logger.info(attachment_jnf_respone)
pdf = pdfkit.from_string(attachment_jnf_respone['html'], False,options={"--enable-local-file-access": "",'--dpi':'96'}) pdf = pdfkit.from_string(attachment_jnf_respone['html'], False,
options={"--enable-local-file-access": "", '--dpi': '96'})
msg.attach(attachment_jnf_respone['name'], pdf, 'application/pdf') msg.attach(attachment_jnf_respone['name'], pdf, 'application/pdf')
msg.send() msg.send()
return True return True
@ -248,6 +251,7 @@ def generateOneTimeVerificationLink(email, opening_id, opening_type):
logger.warning("Utils - generateOneTimeVerificationLink: " + str(sys.exc_info())) logger.warning("Utils - generateOneTimeVerificationLink: " + str(sys.exc_info()))
return False, "_" return False, "_"
def verify_recaptcha(request): def verify_recaptcha(request):
try: try:
print(settings.RECAPTCHA_SECRET_KEY) print(settings.RECAPTCHA_SECRET_KEY)
@ -269,19 +273,25 @@ def verify_recaptcha(request):
logger.warning("Utils - verify_recaptcha: " + str(sys.exc_info())) logger.warning("Utils - verify_recaptcha: " + str(sys.exc_info()))
return False, "_" return False, "_"
def opening_description_table_html(opening): def opening_description_table_html(opening):
details = model_to_dict(opening, fields = [field.name for field in Placement._meta.fields], exclude = ['id','is_company_details_pdf','offer_accepted','is_description_pdf','is_compensation_details_pdf','is_selection_procedure_details_pdf','email_verified']) details = model_to_dict(opening, fields=[field.name for field in Placement._meta.fields],
exclude=['id', 'is_company_details_pdf', 'offer_accepted', 'is_description_pdf',
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf',
'email_verified'])
keys = list(details.keys()) keys = list(details.keys())
newdetails = {} newdetails = {}
for key in keys: for key in keys:
if isinstance(details[key], list): if isinstance(details[key], list):
details[key] = {"details": details[key], "type": ["list"]} details[key] = {"details": details[key], "type": ["list"]}
if key in ['website','company_details_pdf_names','description_pdf_names','compensation_details_pdf_names','selection_procedure_pdf_names']: if key in ['website', 'company_details_pdf_names', 'description_pdf_names', 'compensation_details_pdf_names',
'selection_procedure_pdf_names']:
if key == 'website': if key == 'website':
details[key] = {"details": details[key], "type": ["link"]} details[key] = {"details": details[key], "type": ["link"]}
else: else:
details[key] = {"details": details[key]["details"], "type": ["list","link"], "link": PDF_FILES_SERVING_ENDPOINT+opening.id+"/"} details[key] = {"details": details[key]["details"], "type": ["list", "link"],
new_key = key.replace('_',' ') "link": PDF_FILES_SERVING_ENDPOINT + opening.id + "/"}
new_key = key.replace('_', ' ')
if key.endswith(' names'): if key.endswith(' names'):
new_key = key[:-6] new_key = key[:-6]
new_key = new_key.capitalize() new_key = new_key.capitalize()

View File

@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
""" """
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
load_dotenv("../dev.env") load_dotenv("../dev.env")

View File

@ -158,7 +158,6 @@ Request_Body:
> Only users with `student` role can access this Api. > Only users with `student` role can access this Api.
### Response ### Response
Response is a Json with these fields Response is a Json with these fields
@ -565,8 +564,6 @@ Request_Body:
} }
``` ```
> Headers <br> > Headers <br>
> Authorization: "Bearer {tokenID}" > Authorization: "Bearer {tokenID}"
@ -728,7 +725,6 @@ Response is a Json with these fields
- ongoing: Gives us the list of placements that are accepting applications. - ongoing: Gives us the list of placements that are accepting applications.
- previous: Gives us the list of placements that stopped accepting applications. - previous: Gives us the list of placements that stopped accepting applications.
### Status Codes ### Status Codes
The possible responses for this api request are as follows The possible responses for this api request are as follows

View File

@ -6,7 +6,11 @@
"token_uri": "https://oauth2.googleapis.com/token", "token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "ZzvcweJylL1IDLUnYOi1ws2W", "client_secret": "ZzvcweJylL1IDLUnYOi1ws2W",
"redirect_uris": ["https://www.getpostman.com/oauth2/callback"], "redirect_uris": [
"javascript_origins": ["http://localhost:3000"] "https://www.getpostman.com/oauth2/callback"
],
"javascript_origins": [
"http://localhost:3000"
]
} }
} }

View File

@ -32,7 +32,8 @@
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;"> 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 align="center" style="padding:40px 0 30px 0;background:#334878;">
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/> <img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
style="height:auto;display:block;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -43,7 +44,8 @@
<td style="padding:0 0 36px 0;color:#153643;"> <td style="padding:0 0 36px 0;color:#153643;">
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
We have received your Job Notification. Kindly verify your email by clicking <a href="{{ one_time_link }}">here</a>. We have received your Job Notification. Kindly verify your email by clicking <a
href="{{ one_time_link }}">here</a>.
</p> </p>
</td> </td>
</tr> </tr>

View File

@ -5,26 +5,37 @@
<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) {background: #FFF} #details_table tr:nth-child(even) {
#details_table tr:nth-child(odd) {background: #bfe3f3} background: #FFF
#details_table td {padding: 10px; width: 50%;} }
#details_table{
#details_table tr:nth-child(odd) {
background: #bfe3f3
}
#details_table td {
padding: 10px;
width: 50%;
}
#details_table {
border: #334878 1px solid; border: #334878 1px solid;
border-collapse: collapse; border-collapse: collapse;
width: 80%; width: 80%;
margin:auto; margin: auto;
} }
</style> </style>
<title>Document</title> <title>Document</title>
</head> </head>
<body style="margin: 0;"> <body style="margin: 0;">
<header style="background-color: #334878;"><img style="height: 3cm; margin: auto; display: block; padding: 0.5cm;" src='{{imgpath}}' alt="cdc logo"></header> <header style="background-color: #334878;"><img style="height: 3cm; margin: auto; display: block; padding: 0.5cm;"
<h1 style="text-align: center;"> Job Notification Form Response</h1> src='{{ imgpath }}' alt="cdc logo"></header>
<table id="details_table"> <h1 style="text-align: center;"> Job Notification Form Response</h1>
<table id="details_table">
{% for key, value in data.items %} {% for key, value in data.items %}
<tr> <tr>
<td > <td>
{{ key }} {{ key }}
</td> </td>
<td> <td>
@ -33,9 +44,9 @@
{% for item in value.details %} {% for item in value.details %}
<li> <li>
{% if 'link' in value.type and value.link %} {% if 'link' in value.type and value.link %}
<a href="{{value.link|add:item}}">{{ item }}</a> <a href="{{ value.link|add:item}}">{{ item }}</a>
{% elif 'link' in value.type %} {% elif 'link' in value.type %}
<a href="{{item}}">{{ item }}</a> <a href="{{ item }}">{{ item }}</a>
{% else %} {% else %}
{{ item }} {{ item }}
{% endif %} {% endif %}
@ -52,10 +63,11 @@
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<p style="margin-left: 10%;">In case of any descripency regarding above details, please contact <a href="mailto:cdc@iitdh.ac.in">cdc@iitdh.ac.in</a> <p style="margin-left: 10%;">In case of any descripency regarding above details, please contact <a
href="mailto:cdc@iitdh.ac.in">cdc@iitdh.ac.in</a>
</p> </p>
</body> </body>
</html> </html>

View File

@ -21,10 +21,20 @@
table, td, div, h1, p { table, td, div, h1, p {
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
} }
#details_table tr:nth-child(even) {background: #FFF}
#details_table tr:nth-child(odd) {background: #f9f9f9} #details_table tr:nth-child(even) {
#details_table td {padding: 10px} background: #FFF
#details_table{ }
#details_table tr:nth-child(odd) {
background: #f9f9f9
}
#details_table td {
padding: 10px
}
#details_table {
border: #334878 1px solid; border: #334878 1px solid;
border-collapse: collapse; border-collapse: collapse;
} }
@ -40,7 +50,8 @@
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;"> 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 align="center" style="padding:40px 0 30px 0;background:#334878;">
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/> <img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
style="height:auto;display:block;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -52,8 +63,10 @@
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif; <h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
">Thank You for filling the form</h1> ">Thank You for filling the form</h1>
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
We have received your <b>{{ opening_type }}</b> notification for a <b>{{ designation }}</b> offer at <b> We have received your <b>{{ opening_type }}</b> notification for a
{{ company_name }}</b>. Click <a href="{{ opening_link }}">here</a> to view your notification. <b>{{ designation }}</b> offer at <b>
{{ company_name }}</b>. Click <a href="{{ opening_link }}">here</a> to view your
notification.
</p> </p>
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
We will keep you informed with the updates. If you have any queries, please We will keep you informed with the updates. If you have any queries, please
@ -64,7 +77,7 @@
<table id="details_table"> <table id="details_table">
{% for key, value in data.items %} {% for key, value in data.items %}
<tr> <tr>
<td > <td>
{{ key }} {{ key }}
</td> </td>
<td> <td>
@ -73,9 +86,9 @@
{% for item in value.details %} {% for item in value.details %}
<li> <li>
{% if 'link' in value.type and value.link %} {% if 'link' in value.type and value.link %}
<a href="{{value.link|add:item}}">{{ item }}</a> <a href="{{ value.link|add:item}}">{{ item }}</a>
{% elif 'link' in value.type %} {% elif 'link' in value.type %}
<a href="{{item}}">{{ item }}</a> <a href="{{ item }}">{{ item }}</a>
{% else %} {% else %}
{{ item }} {{ item }}
{% endif %} {% endif %}
@ -111,7 +124,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>

View File

@ -32,7 +32,8 @@
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;"> 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 align="center" style="padding:40px 0 30px 0;background:#334878;">
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/> <img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
style="height:auto;display:block;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -42,17 +43,19 @@
<tr> <tr>
<td style="padding:0 0 36px 0;color:#153643;"> <td style="padding:0 0 36px 0;color:#153643;">
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif; <h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
">{{opening_type}} Opportunity at {{company_name}}</h1> ">{{ 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;"> <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>
<p style="text-indent: 4ch; margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <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 recruiting <b>{{designation}}</b> from IIT Dharwad. CDC is excited to announce that <b>{{ company_name }}</b> is interested in
recruiting <b>{{ designation }}</b> from IIT Dharwad.
More details can be found in the CDC-webportal. More details can be found in the CDC-webportal.
</p> </p>
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
Interested students can apply before <b>{{deadline}}</b> in the <a href="{{link}}">CDC-webportal</a>. Interested students can apply before <b>{{ deadline }}</b> in the <a
href="{{ link }}">CDC-webportal</a>.
</p> </p>
</td> </td>
</tr> </tr>
@ -72,7 +75,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>

View File

@ -31,7 +31,8 @@
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;"> 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 align="center" style="padding:40px 0 30px 0;background:#334878;">
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/> <img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
style="height:auto;display:block;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -43,7 +44,8 @@
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif; <h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
">Hey, {{ student_name }}</h1> ">Hey, {{ student_name }}</h1>
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
We regret to inform you that you have not been selected for <b>{{ designation }}</b> role at <b>{{ company_name }}</b>. We regret to inform you that you have not been selected for
<b>{{ designation }}</b> role at <b>{{ company_name }}</b>.
CDC will keep bringing more such opportunities for you in the future. CDC will keep bringing more such opportunities for you in the future.
</td> </td>
</tr> </tr>

View File

@ -31,7 +31,8 @@
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;"> 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 align="center" style="padding:40px 0 30px 0;background:#334878;">
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/> <img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
style="height:auto;display:block;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -43,7 +44,8 @@
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif; <h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
">Hey, {{ student_name }}</h1> ">Hey, {{ student_name }}</h1>
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
Congratulations, You have been selected for the <b>{{ designation }}</b> at <b>{{ company_name }}</b>.<br> Congratulations, You have been selected for the <b>{{ designation }}</b> at
<b>{{ company_name }}</b>.<br>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -32,7 +32,8 @@
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;"> 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 align="center" style="padding:40px 0 30px 0;background:#334878;">
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/> <img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
style="height:auto;display:block;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -44,7 +45,8 @@
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif; <h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
">Hello, {{ name }}</h1> ">Hello, {{ name }}</h1>
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
We have received your application for a <b>{{ application_type }}</b> offer at <b> We have received your application for a <b>{{ application_type }}</b> offer at
<b>
{{ company_name }}</b>. {{ company_name }}</b>.
{% if additional_info_items %} {% if additional_info_items %}
We received these additional details We received these additional details

View File

@ -32,7 +32,8 @@
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;"> 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 align="center" style="padding:40px 0 30px 0;background:#334878;">
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/> <img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
style="height:auto;display:block;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -42,10 +43,11 @@
<tr> <tr>
<td style="padding:0 0 36px 0;color:#153643;"> <td style="padding:0 0 36px 0;color:#153643;">
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif; <h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
">{{opening_type}} Opportunity at {{company_name}}</h1> ">{{ 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;"> <p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
Gentle reminder for the same. Gentle reminder for the same.
Interested students can apply before <b>{{deadline}}</b> in the <a href="{{link}}">CDC-webportal</a>. Interested students can apply before <b>{{ deadline }}</b> in the <a
href="{{ link }}">CDC-webportal</a>.
</p> </p>
</td> </td>
</tr> </tr>

View File

@ -35,10 +35,13 @@ python# CDC - Backend
2. Update the `CORS_ORIGIN_WHITELIST` list and `CORS_ORIGIN_ALLOW_ALL` variable 2. Update the `CORS_ORIGIN_WHITELIST` list and `CORS_ORIGIN_ALLOW_ALL` variable
### Starting the Email Server ### Starting the Email Server
Run the following command to start the email backend process <br> Run the following command to start the email backend process <br>
`python manage.py process_tasks` `python manage.py process_tasks`
### API Reference ### API Reference
Check [here](./CDC_Backend/README.md) for Api Reference Check [here](./CDC_Backend/README.md) for Api Reference
For Documentation with Postman Collection, click [here](https://documenter.getpostman.com/view/15531322/UVJfhuhQ#568ad036-ad0e-449a-a26f-4d86616b1393) For Documentation with Postman Collection,
click [here](https://documenter.getpostman.com/view/15531322/UVJfhuhQ#568ad036-ad0e-449a-a26f-4d86616b1393)