From 51f56dd0b6db91d8d808995d8b51d20a85baf3c1 Mon Sep 17 00:00:00 2001 From: Carlos Oliveira Date: Tue, 16 Dec 2014 10:55:18 -0200 Subject: [PATCH] Removed 'Register' step from navbar --- colab/accounts/views.py | 10 ++++++++++ colab/templates/base.html | 12 +++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/colab/accounts/views.py b/colab/accounts/views.py index 7a6f653..cfce83d 100644 --- a/colab/accounts/views.py +++ b/colab/accounts/views.py @@ -123,6 +123,16 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView): def signup(request): + user = request.user + + # If the user is not authenticated, redirect to login + if not user.is_authenticated(): + return redirect('login') + + # If the user doesn't need to update its main data, redirect to its profile + if not user.needs_update: + return redirect('user_profile', username=user.username) + # If the request method is GET just return the form if request.method == 'GET': user_form = UserCreationForm() diff --git a/colab/templates/base.html b/colab/templates/base.html index 589ad89..716073b 100644 --- a/colab/templates/base.html +++ b/colab/templates/base.html @@ -119,28 +119,28 @@ {% if proxy.noosfero %}