diff --git a/hc/accounts/backends.py b/hc/accounts/backends.py index f9c74d6c..a279b56a 100644 --- a/hc/accounts/backends.py +++ b/hc/accounts/backends.py @@ -5,7 +5,7 @@ from hc.accounts.models import Profile class BasicBackend(object): def get_user(self, user_id): try: - q = User.objects.select_related("profile", "profile__current_project") + q = User.objects.select_related("profile") return q.get(pk=user_id) except User.DoesNotExist: diff --git a/hc/accounts/middleware.py b/hc/accounts/middleware.py index 87f98cd4..353d492f 100644 --- a/hc/accounts/middleware.py +++ b/hc/accounts/middleware.py @@ -9,9 +9,5 @@ class TeamAccessMiddleware(object): if not request.user.is_authenticated: return self.get_response(request) - profile = Profile.objects.for_user(request.user) - - request.profile = profile - request.project = profile.current_project - + request.profile = Profile.objects.for_user(request.user) return self.get_response(request) diff --git a/hc/accounts/views.py b/hc/accounts/views.py index d463a95f..ae242583 100644 --- a/hc/accounts/views.py +++ b/hc/accounts/views.py @@ -346,9 +346,6 @@ def project(request, code): project.name = form.cleaned_data["name"] project.save() - if request.profile.current_project == project: - request.profile.current_project.name = project.name - ctx["project_name_updated"] = True ctx["project_name_status"] = "success"