Commit 945460cf authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

In project search exclude projects in which user is already member.

parent 5895050c
......@@ -1166,8 +1166,11 @@ def project_search(request):
if q is None:
projects = ProjectApplication.objects.none()
else:
accepted_projects = request.user.projectmembership_set.filter(
~Q(acceptance_date__isnull=True)).values_list('project', flat=True)
projects = ProjectApplication.objects.search_by_name(q)
projects = projects.filter(~Q(project__last_approval_date__isnull=True))
projects = projects.exclude(project__in=accepted_projects)
table = tables.UserProjectApplicationsTable(projects, user=request.user,
prefix="my_projects_")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment