diff --git a/corpus/corpus/settings.py b/corpus/corpus/settings.py index 074ce512..260c3e38 100644 --- a/corpus/corpus/settings.py +++ b/corpus/corpus/settings.py @@ -169,3 +169,11 @@ LOGOUT_REDIRECT_URL = "/" SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") + +# Email Settings +EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" +EMAIL_HOST = os.environ.get("EMAIL_HOST", "smtp.gmail.com") +EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER", "corpusieeenitk@gmail.com") +EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD", "gmailapppassword") +EMAIL_PORT = 465 +EMAIL_USE_SSL = True diff --git a/corpus/embedathon/forms.py b/corpus/embedathon/forms.py index 2b82ac9c..45c5b7eb 100644 --- a/corpus/embedathon/forms.py +++ b/corpus/embedathon/forms.py @@ -1,3 +1,4 @@ +from django import forms from embedathon.models import Announcement from embedathon.models import EmbedathonUser from embedathon.models import Invite @@ -7,11 +8,14 @@ class EmbedathonForm(CorpusModelForm): + nitk_roll_number = forms.CharField(max_length=8, required=False) + class Meta: model = EmbedathonUser fields = [ "from_nitk", "college_name", + "nitk_roll_number", "course", "year", "branch", @@ -20,6 +24,14 @@ class Meta: "cass_member", ] + def clean(self): + data = self.cleaned_data + if data.get("from_nitk", None) and not data.get("nitk_roll_number", None): + raise forms.ValidationError( + "Enter your NITK Roll Number for verification that you are from NITK." + ) + return data + class TeamCreationForm(CorpusModelForm): class Meta: diff --git a/corpus/embedathon/migrations/0005_alter_embedathonuser_year.py b/corpus/embedathon/migrations/0005_alter_embedathonuser_year.py new file mode 100644 index 00000000..a79ee61b --- /dev/null +++ b/corpus/embedathon/migrations/0005_alter_embedathonuser_year.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.4 on 2023-12-27 09:59 +from django.db import migrations +from django.db import models + + +class Migration(migrations.Migration): + + dependencies = [ + ("embedathon", "0004_announcement"), + ] + + operations = [ + migrations.AlterField( + model_name="embedathonuser", + name="year", + field=models.CharField( + choices=[("1", "1st Year"), ("2", "2nd Year"), ("3", "3rd Year")], + max_length=1, + ), + ), + ] diff --git a/corpus/embedathon/models.py b/corpus/embedathon/models.py index f2f22b0f..e2f6528b 100644 --- a/corpus/embedathon/models.py +++ b/corpus/embedathon/models.py @@ -9,7 +9,7 @@ ("S", "B.Sc."), ("O", "Other undergraduate degree"), ] -YEAR = [("1", "1st Year"), ("2", "2nd Year")] +YEAR = [("1", "1st Year"), ("2", "2nd Year"), ("3", "3rd Year")] PAYMENT_STATUS = [("E", "Exempt"), ("U", "Fee Not Paid"), ("P", "Fee Paid")] diff --git a/corpus/requirements.txt b/corpus/requirements.txt index bc980db9..6dc825b3 100644 --- a/corpus/requirements.txt +++ b/corpus/requirements.txt @@ -1,5 +1,5 @@ asgiref==3.7.2 -Django==4.2.4 +Django==4.2.7 gunicorn==21.2.0 packaging==23.1 Pillow==10.0.1 diff --git a/corpus/templates/embedathon/home.html b/corpus/templates/embedathon/home.html index 8c0a69d4..88a95328 100644 --- a/corpus/templates/embedathon/home.html +++ b/corpus/templates/embedathon/home.html @@ -142,7 +142,7 @@
This is going to be a pan-India event so all the 1st and 2nd Year B.E/B.Tech/B.Sc
+ This is going to be a pan-India event so all the 1st, 2nd and 3rd Year B.E/B.Tech/B.Sc
students from any college can register for the event.