equal
deleted
inserted
replaced
26 @login_required |
26 @login_required |
27 def view_user_profile(request, user_id): |
27 def view_user_profile(request, user_id): |
28 """ Display the profile information of the user specified in the ID. |
28 """ Display the profile information of the user specified in the ID. |
29 """ |
29 """ |
30 |
30 |
31 |
|
32 user = shortcuts.get_object_or_404(User, pk=user_id) |
31 user = shortcuts.get_object_or_404(User, pk=user_id) |
33 profile = user.get_profile() |
32 profile = user.get_profile() |
34 |
33 |
35 context = {"user": user, |
34 context = {"user": user, |
36 "profile": profile, |
35 "profile": profile, |
162 profile = user.get_profile() |
161 profile = user.get_profile() |
163 |
162 |
164 viewing_user = get_user(uid) |
163 viewing_user = get_user(uid) |
165 viewing_profile = viewing_user.get_profile() |
164 viewing_profile = viewing_user.get_profile() |
166 |
165 |
167 working_tasks = viewing_user.approved_tasks.filter(status="WR") |
166 working_tasks = viewing_user.approved_tasks.filter(status="Working") |
168 completed_tasks = viewing_user.approved_tasks.filter(status="CM") |
167 completed_tasks = viewing_user.approved_tasks.filter(status="Completed") |
169 reviewing_tasks = viewing_user.reviewing_tasks.all() |
168 reviewing_tasks = viewing_user.reviewing_tasks.all() |
170 claimed_tasks = viewing_user.claimed_tasks.all() |
169 claimed_tasks = viewing_user.claimed_tasks.all() |
171 |
170 |
172 can_view_info = True if profile.rights in ["MG", "DC"] else False |
171 can_view_info = True if profile.role in [ |
|
172 'Administrator', 'Coordinator'] else False |
173 |
173 |
174 context = {"user": user, |
174 context = {"user": user, |
175 "profile": profile, |
175 "profile": profile, |
176 "viewing_user": viewing_user, |
176 "viewing_user": viewing_user, |
177 "viewing_profile": viewing_profile, |
177 "viewing_profile": viewing_profile, |