Commit 6ab52be6 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Do not show default groups in project lists

parent 395090b5
......@@ -306,6 +306,6 @@ class DjangoBackend(BaseBackend):
g.permissions = permissions
g.policies = policies
g.members = members
# g.members = members
g.owners = owners
return self._list(AstakosGroup, filter=(g.id,))
......@@ -33,9 +33,9 @@
<li class="create">
<div>
<div class="wrap">
<p><a href="{% url group_add 'course' %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
<p><a href="{% url group_add 'project' %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
<p class="txt">Create a new Project in seconds. Specify how many members it will have, which and how many virtual resources it will provide to its members. Describe its purpose. Submit your request and if accepted, you and your colleagues are ready to deploy! </p>
<p><a href="{% url group_add 'default' %}">create a project ></a></p>
<p><a href="{% url group_add 'project' %}">create a project ></a></p>
<!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>-->
</div>
</div>
......
......@@ -58,11 +58,11 @@ from django.views.generic.create_update import (delete_object,
from django.views.generic.list_detail import object_list
from django.core.xheaders import populate_xheaders
from django.core.exceptions import ValidationError, PermissionDenied
from django.template.loader import render_to_string
from django.views.decorators.http import require_http_methods
from astakos.im.activation_backends import get_backend, SimpleBackend
from django.db.models import Q
from astakos.im.activation_backends import get_backend, SimpleBackend
from astakos.im.models import (AstakosUser, ApprovalTerms, AstakosGroup,
EmailChange, GroupKind, Membership,
RESOURCE_SEPARATOR, AstakosUserAuthProvider)
......@@ -937,6 +937,7 @@ def group_list(request):
LEFT JOIN auth_user as owner ON (
im_astakosuser_owner.astakosuser_id = owner.id)
WHERE im_membership.person_id = %(userid)s
AND im_groupkind.name != 'default'
"""
params = {'userid':request.user.id}
......@@ -1073,6 +1074,7 @@ def group_search(request, extra_context=None, **kwargs):
sorting = 'groupname'
if q:
queryset = AstakosGroup.objects.select_related()
queryset = queryset.filter(~Q(kind__name='default'))
queryset = queryset.filter(name__contains=q)
queryset = queryset.filter(approval_date__isnull=False)
queryset = queryset.extra(select={
......@@ -1130,6 +1132,7 @@ def group_search(request, extra_context=None, **kwargs):
@login_required
def group_all(request, extra_context=None, **kwargs):
q = AstakosGroup.objects.select_related()
q = q.filter(~Q(kind__name='default'))
q = q.filter(approval_date__isnull=False)
q = q.extra(select={
'groupname': "auth_group.name",
......
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