Merge pull request #151 from CDC-IITDH/gowtham/email-notification&minor-fixes

Gowtham/email notification&minor fixes
This commit is contained in:
karthik mv 2022-12-06 17:13:56 +05:30 committed by GitHub
commit fb7d0550fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -172,12 +172,17 @@ def PlacementApplicationConditions(student, placement):
selected_companies = PlacementApplication.objects.filter(student=student, selected=True)
selected_companies_PSU = [i for i in selected_companies if i.placement.tier == 'psu']
PPO = PrePlacementOffer.objects.filter(student=student, accepted=True)
PPO_PSU = [i for i in PPO if i.tier == 'psu']
# find length of PPO
if len(selected_companies) + len(PPO) >= MAX_OFFERS_PER_STUDENT:
raise PermissionError("Max Applications Reached for the Season")
if len(selected_companies_PSU) > 0:
raise PermissionError('Selected for PSU Can\'t apply anymore')
if len(PPO_PSU) > 0:
raise PermissionError('Selected for PSU Can\'t apply anymore')
if placement.tier == 'psu':
return True, "Conditions Satisfied"
@ -186,7 +191,7 @@ def PlacementApplicationConditions(student, placement):
return False, "Can't apply for this tier"
for i in PPO:
if int(i.placement.tier) < int(placement.tier):
if int(i.tier) < int(placement.tier):
return False, "Can't apply for this tier"
if student.degree != 'bTech' and not placement.rs_eligible:

View File

@ -30,6 +30,7 @@ DEBUG = os.environ.get('DEBUG') == "True"
ALLOWED_HOSTS = ['cdc.iitdh.ac.in', 'localhost']
ADMINS = [('Gowtham Sai', '190010036@iitdh.ac.in'), ('Karthik Mv', '200010030@iitdh.ac.in')]
# Application definition
INSTALLED_APPS = [
@ -185,14 +186,13 @@ LOGGING = {
'class': 'django_db_logger.db_log_handler.DatabaseLogHandler'
},
'mail_admins': {
'level': 'ERROR',
'level': 'WARNING',
'class': 'django.utils.log.AdminEmailHandler',
'include_html': True,
}
},
'loggers': {
'db': {
'handlers': ['db_log'],
'handlers': ['db_log', 'mail_admins'],
'level': 'DEBUG'
}
}