Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
a9b7a981
Commit
a9b7a981
authored
Sep 28, 2012
by
Sofia Papagiannaki
Browse files
Do now allow owner to leave group: remove link from group search
parent
fa4e420c
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html
View file @
a9b7a981
...
...
@@ -91,9 +91,11 @@
{% if o.membership_approval_date %}
Registered
<form
action=
"{% url group_leave o.id %}"
method=
"post"
class=
"link-like"
>
{% csrf_token %}
<input
type=
"submit"
value=
"LEAVE GROUP"
/>
</form>
{% if not o.is_owner %}
<form
action=
"{% url group_leave o.id %}"
method=
"post"
class=
"link-like"
>
{% csrf_token %}
<input
type=
"submit"
value=
"LEAVE GROUP"
/>
</form>
{% endif %}
...
...
snf-astakos-app/astakos/im/views.py
View file @
a9b7a981
...
...
@@ -885,6 +885,12 @@ def group_search(request, extra_context=None, **kwargs):
SELECT date_joined FROM im_membership
WHERE group_id = im_astakosgroup.group_ptr_id
AND person_id = %s)
THEN 1 ELSE 0 END"""
%
request
.
user
.
id
,
'is_owner'
:
"""
SELECT CASE WHEN EXISTS(
SELECT id FROM im_astakosuser_owner
WHERE astakosgroup_id = im_astakosgroup.group_ptr_id
AND astakosuser_id = %s)
THEN 1 ELSE 0 END"""
%
request
.
user
.
id
})
if
sorting
:
# TODO check sorting value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment