request.project is now unused, removing

This commit is contained in:
Pēteris Caune 2020-02-26 10:37:19 +02:00
parent 9c3f7101db
commit 6a0c90853b
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
3 changed files with 2 additions and 9 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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"