return only topics belonging to participation site
This commit is contained in:
parent
25c15440d2
commit
28f7fb782c
|
@ -73,4 +73,9 @@ class Participation(PonyConfModel):
|
||||||
return self.user.is_superuser or self.orga
|
return self.user.is_superuser or self.orga
|
||||||
|
|
||||||
def is_staff(self):
|
def is_staff(self):
|
||||||
return self.is_orga() or self.user.topic_set.exists()
|
return self.is_orga() or self.topic_set.exists()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def topic_set(self):
|
||||||
|
from proposals.models import Topic
|
||||||
|
return Topic.objects.filter(site=self.site, reviewers=self.user)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<td><a href="{{ participation.get_absolute_url }}">{{ participation.user.username }}</a></td>
|
<td><a href="{{ participation.get_absolute_url }}">{{ participation.user.username }}</a></td>
|
||||||
<td>{{ participation.user.get_full_name }}</td>
|
<td>{{ participation.user.get_full_name }}</td>
|
||||||
<td>{{ participation.is_orga|yesno:"✔,✘" }}</td>
|
<td>{{ participation.is_orga|yesno:"✔,✘" }}</td>
|
||||||
<td>{% for topic in participation.user.topic_set.all %}{{ topic.get_link }}{% if not forloop.last %},
|
<td>{% for topic in participation.topic_set.all %}{{ topic.get_link }}{% if not forloop.last %},
|
||||||
{% endif %}{% endfor %}</td>
|
{% endif %}{% endfor %}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'conversation' participation.user.username %}" data-toggle="tooltip" data-placement="bottom"
|
<a href="{% url 'conversation' participation.user.username %}" data-toggle="tooltip" data-placement="bottom"
|
||||||
|
|
|
@ -16,4 +16,4 @@ def is_staff(request, user):
|
||||||
|
|
||||||
def can_edit_profile(request, profile):
|
def can_edit_profile(request, profile):
|
||||||
editor = request.user.participation_set.get(site=get_current_site(request))
|
editor = request.user.participation_set.get(site=get_current_site(request))
|
||||||
return editor.is_orga() or editor.user.topic_set.filter(talk__speakers=profile.user).exists()
|
return editor.is_orga() or editor.topic_set.filter(talk__speakers=profile.user).exists()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user