From 043693f0825285ffd130e4e9cdfd396e741852ff Mon Sep 17 00:00:00 2001 From: Bobby Date: Mon, 29 Aug 2022 13:14:33 -0400 Subject: Disable Homepage, Profile Visibility and User Specific URL temporarily --- blog/urls.py | 2 +- templates/blog/account.html | 4 ++-- templates/blog/partials/sidebar.html | 2 +- users/views.py | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/blog/urls.py b/blog/urls.py index 7824476c..e00f3183 100644 --- a/blog/urls.py +++ b/blog/urls.py @@ -7,5 +7,5 @@ urlpatterns = [ path('my/', RedirectView.as_view(pattern_name='account', permanent=False)), path('account/', RedirectView.as_view(pattern_name='account', permanent=False)), path('my/account', views.account, name='account'), - path('my/homepage', views.homepage, name='homepage'), + # path('my/homepage', views.homepage, name='homepage'), ] diff --git a/templates/blog/account.html b/templates/blog/account.html index e219e978..84f63613 100644 --- a/templates/blog/account.html +++ b/templates/blog/account.html @@ -63,7 +63,7 @@ - + {% comment %} - {% endif %} + {% endif %} {% endcomment %} diff --git a/templates/blog/partials/sidebar.html b/templates/blog/partials/sidebar.html index cd46c18a..63fb8dde 100644 --- a/templates/blog/partials/sidebar.html +++ b/templates/blog/partials/sidebar.html @@ -45,7 +45,7 @@
  • Blog
  • {% if user.is_authenticated %}
  • My Account
  • -
  • My Homepage
  • + {% comment %}
  • My Homepage
  • {% endcomment %} {% else %}
  • Register
  • {% endif %} diff --git a/users/views.py b/users/views.py index 03773a7f..a269c2ef 100644 --- a/users/views.py +++ b/users/views.py @@ -50,11 +50,14 @@ def update_user(request): location = request.POST['location'] gravatar_email = request.POST['gravatarEmail'] bio = request.POST['bio'] - is_public = True if request.POST['isPublic'] == '1' else False + is_public = False email_public = False if 'emailPublic' in request.POST: email_public = True if request.POST['emailPublic'] == '1' and is_public else False + if 'isPublic' in request.POST: + is_public = True if request.POST['isPublic'] == '1' and is_public else False + if username is not None: user = User.objects.get(username=username) user.first_name = first_name -- cgit v1.2.3