diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/accounts/forms.py b/accounts/forms.py
index d006ee4..a6ed970 100644
--- a/accounts/forms.py
+++ b/accounts/forms.py
@@ -324,6 +324,14 @@ class ProfileUpdateForm(UserChangeForm):
label="Address / city",
)
+ program = forms.ModelChoiceField(
+ queryset=Program.objects.all(),
+ widget=forms.Select(
+ attrs={"class": "browser-default custom-select form-control"}
+ ),
+ label="Program",
+ )
+
class Meta:
model = User
fields = [
@@ -337,6 +345,21 @@ class ProfileUpdateForm(UserChangeForm):
]
+class ProgramUpdateForm(UserChangeForm):
+ program = forms.ModelChoiceField(
+ queryset=Program.objects.all(),
+ widget=forms.Select(
+ attrs={"class": "browser-default custom-select form-control"}
+ ),
+ label="Program",
+ )
+
+ class Meta:
+ model = Student
+ fields = [
+ "program"
+ ]
+
class EmailValidationOnForgotPassword(PasswordResetForm):
def clean_email(self):
email = self.cleaned_data["email"]
diff --git a/accounts/urls.py b/accounts/urls.py
index fd0737d..16dbe5a 100644
--- a/accounts/urls.py
+++ b/accounts/urls.py
@@ -22,6 +22,7 @@ from .views import (
student_add_view,
edit_student,
delete_student,
+ edit_program,
ParentAdd,
validate_username,
register,
@@ -47,6 +48,7 @@ urlpatterns = [
path("student/add/", student_add_view, name="add_student"),
path("student/Student Program Update Form
+
+{% include 'snippets/messages.html' %}
+
+
+{% endblock content %}
diff --git a/templates/accounts/edit_student.html b/templates/accounts/edit_student.html
index 8a56495..25b7169 100644
--- a/templates/accounts/edit_student.html
+++ b/templates/accounts/edit_student.html
@@ -30,6 +30,7 @@
{{ form.gender|as_crispy_field }}
{{ form.phone|as_crispy_field }}
{{ form.address|as_crispy_field }}
+ {{ form.program|as_crispy_field }}
diff --git a/templates/accounts/email/new_student_account_confirmation.html b/templates/accounts/email/new_student_account_confirmation.html
index 9e35d9d..c04c6db 100755
--- a/templates/accounts/email/new_student_account_confirmation.html
+++ b/templates/accounts/email/new_student_account_confirmation.html
@@ -268,8 +268,8 @@
To secure your account be sure to change your password.
diff --git a/templates/accounts/profile_single.html b/templates/accounts/profile_single.html
index f3030b8..cc38a78 100644
--- a/templates/accounts/profile_single.html
+++ b/templates/accounts/profile_single.html
@@ -38,6 +38,10 @@
Edit Profile
+ {# had to name out of convention because it clashes with 'edit_[whatever]program', which directs to 'program/[id]/edit/ #}
+{# #}
+{# Change Program#}
+{# #}
{% endif %}
{% if user.is_lecturer %}
@@ -93,6 +97,7 @@
School: Hawas Preparatory School Level: {{ level.level }} Program: {{ student.program }}