fewer calls on account_read view

This commit is contained in:
Aurélien Delobelle 2017-04-06 14:38:25 +02:00
parent c9019c4eb4
commit 56fa70e495

View file

@ -351,7 +351,11 @@ def account_create_ajax(request, username=None, login_clipper=None,
@login_required
def account_read(request, trigramme):
try:
account = Account.objects.select_related('negative').get(trigramme=trigramme)
account = (
Account.objects
.select_related('cofprofile__user', 'negative')
.get(trigramme=trigramme)
)
except Account.DoesNotExist:
raise Http404