Commit 51f56dd0b6db91d8d808995d8b51d20a85baf3c1
Committed by
Sergio Oliveira
1 parent
44dd3d4a
Exists in
master
and in
39 other branches
Removed 'Register' step from navbar
Now to access this step the user must be authenticated and in need to update its main data Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Showing
2 changed files
with
15 additions
and
7 deletions
Show diff stats
colab/accounts/views.py
... | ... | @@ -123,6 +123,16 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView): |
123 | 123 | |
124 | 124 | |
125 | 125 | def signup(request): |
126 | + user = request.user | |
127 | + | |
128 | + # If the user is not authenticated, redirect to login | |
129 | + if not user.is_authenticated(): | |
130 | + return redirect('login') | |
131 | + | |
132 | + # If the user doesn't need to update its main data, redirect to its profile | |
133 | + if not user.needs_update: | |
134 | + return redirect('user_profile', username=user.username) | |
135 | + | |
126 | 136 | # If the request method is GET just return the form |
127 | 137 | if request.method == 'GET': |
128 | 138 | user_form = UserCreationForm() | ... | ... |
colab/templates/base.html
... | ... | @@ -119,28 +119,28 @@ |
119 | 119 | {% if proxy.noosfero %} |
120 | 120 | <li class="dropdown"> |
121 | 121 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
122 | - {% trans "Social" %} <b class="caret"></b> | |
122 | + {% trans "Social" %} <b class="caret"></b> | |
123 | 123 | </a> |
124 | 124 | <ul class="dropdown-menu"> |
125 | 125 | <li> |
126 | 126 | <a href="/social/search/people"> |
127 | - {% trans "Users" %} | |
127 | + {% trans "Users" %} | |
128 | 128 | </a> |
129 | 129 | </li> |
130 | 130 | <li> |
131 | 131 | <a href="/social/search/communities"> |
132 | - {% trans "Communities" %} | |
132 | + {% trans "Communities" %} | |
133 | 133 | </a> |
134 | 134 | </li> |
135 | 135 | {% if user.is_active %} |
136 | 136 | <li> |
137 | 137 | <a href="/social/profile/{{ user.username }}"> |
138 | - {% trans "Profile" %} | |
138 | + {% trans "Profile" %} | |
139 | 139 | </a> |
140 | 140 | </li> |
141 | 141 | <li> |
142 | 142 | <a href="/social/myprofile/{{ user.username }}"> |
143 | - {% trans "Control panel" %} | |
143 | + {% trans "Control panel" %} | |
144 | 144 | </a> |
145 | 145 | </li> |
146 | 146 | {% endif %} |
... | ... | @@ -180,12 +180,10 @@ |
180 | 180 | <li class="dropdown hidden-xs hidden-lg"> |
181 | 181 | <a href="#" class="dropdown-toggle" data-toggle="dropdown">Acesso <b class="caret"></b></a> |
182 | 182 | <ul class="dropdown-menu"> |
183 | - <li><a href="{% url 'signup' %}">{% trans "Register" %}</a></li> | |
184 | 183 | {% trans 'Login' as login_text %} |
185 | 184 | <li>{% browserid_login text=login_text %}</li> |
186 | 185 | </ul> |
187 | 186 | </li> |
188 | - <li class="visible-xs hidden-sm hidden-md"><a href="{% url 'signup' %}">{% trans "Register" %}</a></li> | |
189 | 187 | {% trans 'Login' as login_text %} |
190 | 188 | <li class="visible-xs hidden-sm hidden-md">{% browserid_login text=login_text %}</li> |
191 | 189 | {% else %} | ... | ... |