Commit 65b2ccab authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Fix group list view working with sqlite

parent 30ffd814
...@@ -925,7 +925,7 @@ def group_list(request): ...@@ -925,7 +925,7 @@ def group_list(request):
(SELECT CASE WHEN( (SELECT CASE WHEN(
SELECT date_joined FROM im_membership SELECT date_joined FROM im_membership
WHERE group_id = im_astakosgroup.group_ptr_id WHERE group_id = im_astakosgroup.group_ptr_id
AND person_id = %(userid)s) IS NULL AND person_id = %(id)s) IS NULL
THEN 0 ELSE 1 END) AS membership_status THEN 0 ELSE 1 END) AS membership_status
FROM im_astakosgroup FROM im_astakosgroup
INNER JOIN im_membership ON ( INNER JOIN im_membership ON (
...@@ -936,10 +936,9 @@ def group_list(request): ...@@ -936,10 +936,9 @@ def group_list(request):
im_astakosuser_owner.astakosgroup_id = im_astakosgroup.group_ptr_id) im_astakosuser_owner.astakosgroup_id = im_astakosgroup.group_ptr_id)
LEFT JOIN auth_user as owner ON ( LEFT JOIN auth_user as owner ON (
im_astakosuser_owner.astakosuser_id = owner.id) im_astakosuser_owner.astakosuser_id = owner.id)
WHERE im_membership.person_id = %(userid)s WHERE im_membership.person_id = %(id)s
AND im_groupkind.name != 'default' AND im_groupkind.name != 'default'
""" """ % request.user.__dict__
params = {'userid':request.user.id}
# validate sorting # validate sorting
sorting = 'groupname' sorting = 'groupname'
...@@ -948,7 +947,7 @@ def group_list(request): ...@@ -948,7 +947,7 @@ def group_list(request):
sorting = sort_form.cleaned_data.get('sorting') sorting = sort_form.cleaned_data.get('sorting')
query = query+" ORDER BY %s ASC" %sorting query = query+" ORDER BY %s ASC" %sorting
q = AstakosGroup.objects.raw(query, params=params) q = AstakosGroup.objects.raw(query)
# Create the template, context, response # Create the template, context, response
template_name = "%s/%s_list.html" % ( template_name = "%s/%s_list.html" % (
......
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