Skip to content

Commit

Permalink
[#1799] Show all projects in MyRSR for superusers or RSR admins
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Sep 29, 2015
1 parent d079b28 commit c0ae31e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions akvo/rsr/views/my_rsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,14 @@ def my_updates(request):
def my_projects(request):
"""Directory of Projects connected to the user."""
organisations = request.user.employers.approved().organisations()
projects = organisations.all_projects().distinct().select_related(
'publishingstatus',
'primary_location__country',
)

if request.user.is_superuser or request.user.is_admin:
projects = Project.objects.all()
else:
projects = organisations.all_projects().distinct().select_related(
'publishingstatus',
'primary_location__country',
)

new_project_custom_fields = OrganisationCustomField.objects.filter(
organisation__in=organisations
Expand Down

0 comments on commit c0ae31e

Please sign in to comment.