From a99a6e1303b537cb83c2491cb71e76dc99c98ff8 Mon Sep 17 00:00:00 2001 From: Theo Ouzhinski Date: Thu, 10 Oct 2019 19:50:53 -0400 Subject: [PATCH] fix(preferences): disable privacy options form --- intranet/apps/preferences/views.py | 20 ++++++++++++------- .../templates/preferences/preferences.html | 10 ++++++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/intranet/apps/preferences/views.py b/intranet/apps/preferences/views.py index e0ba12b30a3..afb2ae48956 100644 --- a/intranet/apps/preferences/views.py +++ b/intranet/apps/preferences/views.py @@ -80,13 +80,11 @@ def get_preferred_pic(user): def save_preferred_pic(request, user): preferred_pic = get_preferred_pic(user) - logger.debug(preferred_pic) preferred_pic_form = PreferredPictureForm(user, data=request.POST, initial=preferred_pic) if preferred_pic_form.is_valid(): logger.debug("Preferred pic form: valid") if preferred_pic_form.has_changed(): fields = preferred_pic_form.cleaned_data - logger.debug(fields) if "preferred_photo" in fields: # These aren't actually the Photos, these are the grade_numbers of the Photos new_preferred_pic = fields["preferred_photo"] @@ -299,12 +297,16 @@ def preferences_view(request): user = request.user if request.method == "POST": - logger.debug(dict(request.POST)) phone_formset, email_formset, website_formset, errors = save_personal_info(request, user) if user.is_student: preferred_pic_form = save_preferred_pic(request, user) bus_route_form = save_bus_route(request, user) - privacy_options_form = save_privacy_options(request, user) + """ + The privacy options form is disabled due to the + permissions feature being unused and changes to school policy. + """ + # privacy_options_form = save_privacy_options(request, user) + privacy_options_form = None else: preferred_pic_form = None bus_route_form = None @@ -333,13 +335,18 @@ def preferences_view(request): if user.is_student: preferred_pic = get_preferred_pic(user) bus_route = get_bus_route(user) - logger.debug(preferred_pic) preferred_pic_form = PreferredPictureForm(user, initial=preferred_pic) bus_route_form = BusRouteForm(initial=bus_route) + """ + The privacy options form is disabled due to the + permissions feature being unused and changes to school policy. + """ + """ privacy_options = get_privacy_options(user) - logger.debug(privacy_options) privacy_options_form = PrivacyOptionsForm(user, initial=privacy_options) + """ + privacy_options_form = None else: bus_route_form = None preferred_pic = None @@ -347,7 +354,6 @@ def preferences_view(request): privacy_options_form = None notification_options = get_notification_options(user) - logger.debug(notification_options) notification_options_form = NotificationOptionsForm(user, initial=notification_options) dark_mode_form = None diff --git a/intranet/templates/preferences/preferences.html b/intranet/templates/preferences/preferences.html index 0a05a11a022..8fa74560719 100644 --- a/intranet/templates/preferences/preferences.html +++ b/intranet/templates/preferences/preferences.html @@ -205,7 +205,7 @@

Personal Information

{% if preferred_pic_form %}

Preferred Picture

-

Since the eighth period office and TJ faculty can always see your pictures, it is recommended that you choose your preferred picture even if you disable "Show Pictures" in Privacy Options.

+

Since the eighth period office and TJ faculty can always see your pictures, it is recommended that you choose your preferred picture.

{% for choice in preferred_pic_form.preferred_photo %} {{ choice.tag }} {{ choice.choice_label }}
@@ -213,9 +213,14 @@

Preferred Picture


{% endif %} + {% comment %} + The below privacy options form is disabled due to the + permissions feature being unused and changes to school policy. + {% endcomment %} + {% comment %} {% if privacy_options_form %}

Privacy Options

-

Note that TJ staff members can view all of this information. Want to modify the privacy permissions authorized by your parents? Complete this form and give it to the eighth period office.

+

Note that TJ staff members can view all of this information.

{% if request.user.is_student %} @@ -247,6 +252,7 @@

Privacy Options


{% endif %} + {% endcomment %} {% if dark_mode_form %}

Dark Mode