diff --git a/contributors/views/user_settings.py b/contributors/views/user_settings.py index 64214f8..0a0283a 100644 --- a/contributors/views/user_settings.py +++ b/contributors/views/user_settings.py @@ -18,17 +18,15 @@ class ChangeTokenView( ): """Changing user git_hub token page view.""" - template_name = 'user_settings.html' - not_auth_msg = _('Please log in with your GitHub') - no_permission_msg = ( - _("You haven't got permission to access this section") - ) - redirect_url = reverse_lazy('contributors:home') + template_name = "contributor/user_settings.html" + not_auth_msg = _("Please log in with your GitHub") + no_permission_msg = _("You haven't got permission to access this section") + redirect_url = reverse_lazy("contributors:home") def get_context_data(self, **kwargs): """Add additional context for the settings.""" context = super().get_context_data(**kwargs) - context['user'] = self.request.user + context["user"] = self.request.user return context def post(self, request, *args, **kwargs): @@ -36,17 +34,21 @@ def post(self, request, *args, **kwargs): form = UserTokenForm(request.POST) if form.is_valid(): user = request.user - github_token = form.cleaned_data['github_token'] + github_token = form.cleaned_data["github_token"] user.github_token = github_token user.save() - messages.success(request, _('GitHub token changed successfully')) - return redirect(reverse_lazy( - 'contributors:user_settings', - kwargs={'slug': kwargs.get('slug')}, - )) + messages.success(request, _("GitHub token changed successfully")) + return redirect( + reverse_lazy( + "contributors:user_settings", + kwargs={"slug": kwargs.get("slug")}, + ) + ) - messages.error(request, _('An error occurred. Please try again')) - return redirect(reverse_lazy( - 'contributors:user_settings', - kwargs={'slug': kwargs.get('slug')}, - )) + messages.error(request, _("An error occurred. Please try again")) + return redirect( + reverse_lazy( + "contributors:user_settings", + kwargs={"slug": kwargs.get("slug")}, + ) + ) diff --git a/templates/components/navbar.html b/templates/components/navbar.html index 1465aad..c1174c9 100644 --- a/templates/components/navbar.html +++ b/templates/components/navbar.html @@ -67,7 +67,10 @@ {% if user.contributor %} {% trans "Settings" %} {% endif %} - {% trans "Log out" %} + {% else %}