Browse Source

request.project is now unused, removing

pull/340/head
Pēteris Caune 5 years ago
parent
commit
6a0c90853b
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
3 changed files with 2 additions and 9 deletions
  1. +1
    -1
      hc/accounts/backends.py
  2. +1
    -5
      hc/accounts/middleware.py
  3. +0
    -3
      hc/accounts/views.py

+ 1
- 1
hc/accounts/backends.py View File

@ -5,7 +5,7 @@ from hc.accounts.models import Profile
class BasicBackend(object): class BasicBackend(object):
def get_user(self, user_id): def get_user(self, user_id):
try: try:
q = User.objects.select_related("profile", "profile__current_project")
q = User.objects.select_related("profile")
return q.get(pk=user_id) return q.get(pk=user_id)
except User.DoesNotExist: except User.DoesNotExist:


+ 1
- 5
hc/accounts/middleware.py View File

@ -9,9 +9,5 @@ class TeamAccessMiddleware(object):
if not request.user.is_authenticated: if not request.user.is_authenticated:
return self.get_response(request) 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) return self.get_response(request)

+ 0
- 3
hc/accounts/views.py View File

@ -346,9 +346,6 @@ def project(request, code):
project.name = form.cleaned_data["name"] project.name = form.cleaned_data["name"]
project.save() project.save()
if request.profile.current_project == project:
request.profile.current_project.name = project.name
ctx["project_name_updated"] = True ctx["project_name_updated"] = True
ctx["project_name_status"] = "success" ctx["project_name_status"] = "success"


Loading…
Cancel
Save