From 7e198154d92ba4dcbd8d358efccdcb6275d7fb6d Mon Sep 17 00:00:00 2001 From: yomguy Date: Tue, 12 Feb 2013 12:27:10 +0100 Subject: [PATCH] simplify total_progress --- teleforma/context_processors.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/teleforma/context_processors.py b/teleforma/context_processors.py index 3f7d467d..96998b2c 100644 --- a/teleforma/context_processors.py +++ b/teleforma/context_processors.py @@ -141,17 +141,7 @@ def total_progress(request): if not user.is_authenticated(): return {'total_progress': 0} - auditor = user.auditor.all() - professor = user.professor.all() - - if auditor and not (user.is_staff or user.is_superuser): - seminars = auditor[0].seminars.all() - elif user.is_superuser or user.is_staff: - seminars = Seminar.objects.all() - elif professor: - seminars = all_seminars(request)['all_seminars'] - else: - seminars = None + seminars = all_seminars(request)['all_seminars'] for seminar in seminars: progress += seminar_progress(user, seminar) -- 2.39.5