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 %}