Not show nominees and nominee positions duplicated
See #970 #973 - Legacy-Id: 5589
This commit is contained in:
parent
c5c33c29bc
commit
da52637e9b
|
@ -27,19 +27,31 @@ class NomineePositionQuerySet(QuerySet):
|
|||
return self.by_state('pending')
|
||||
|
||||
def declined(self):
|
||||
""" only draft objects """
|
||||
""" only declined objects """
|
||||
return self.by_state('declined')
|
||||
|
||||
def not_duplicated(self):
|
||||
return self.filter(nominee__duplicated__isnull=True)
|
||||
|
||||
|
||||
class NomineePositionManager(models.Manager, MixinManager):
|
||||
def get_query_set(self):
|
||||
return NomineePositionQuerySet(self.model)
|
||||
|
||||
|
||||
class NomineeManager(models.Manager):
|
||||
class NomineeManagerQuerySet(QuerySet):
|
||||
|
||||
def get_by_nomcom(self, nomcom):
|
||||
return self.filter(nomcom=nomcom)
|
||||
|
||||
def not_duplicated(self):
|
||||
return self.filter(duplicated__isnull=True)
|
||||
|
||||
|
||||
class NomineeManager(models.Manager, MixinManager):
|
||||
def get_query_set(self):
|
||||
return NomineeManagerQuerySet(self.model)
|
||||
|
||||
|
||||
class PositionQuerySet(QuerySet):
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ def private_key(request, year):
|
|||
@member_required(role='member')
|
||||
def private_index(request, year):
|
||||
nomcom = get_nomcom_by_year(year)
|
||||
all_nominee_positions = NomineePosition.objects.get_by_nomcom(nomcom)
|
||||
all_nominee_positions = NomineePosition.objects.get_by_nomcom(nomcom).not_duplicated()
|
||||
is_chair = nomcom.group.is_chair(request.user)
|
||||
message = None
|
||||
if is_chair and request.method == 'POST':
|
||||
|
@ -382,7 +382,7 @@ def process_nomination_status(request, year, nominee_position_id, state, date, h
|
|||
@private_key_required
|
||||
def view_feedback(request, year):
|
||||
nomcom = get_nomcom_by_year(year)
|
||||
nominees = Nominee.objects.get_by_nomcom(nomcom).distinct()
|
||||
nominees = Nominee.objects.get_by_nomcom(nomcom).not_duplicated().distinct()
|
||||
|
||||
return render_to_response('nomcom/view_feedback.html',
|
||||
{'year': year,
|
||||
|
|
|
@ -58,9 +58,9 @@ table.nominees tr td {
|
|||
|
||||
<table class="nominees">
|
||||
{% for p in positions %}
|
||||
{% if p.nomineeposition_set.accepted %}
|
||||
{% if p.nomineeposition_set.accepted.not_duplicated %}
|
||||
<tr><th>{{ p.name }}:</th></tr>
|
||||
{% for np in p.nomineeposition_set.accepted %}
|
||||
{% for np in p.nomineeposition_set.accepted.not_duplicated %}
|
||||
<tr>
|
||||
<td><a href="{% url nomcom_private_feedback year %}?nominee={{np.nominee.id}}&position={{ np.position.id}}">{{ np.nominee.email.person.name }}</td>
|
||||
</tr>
|
||||
|
|
|
@ -103,7 +103,7 @@ replied to the nomination notification they have received.){% endif %}</p>
|
|||
<th>State</th>
|
||||
<th>Questionnaire</th>
|
||||
</tr>
|
||||
{% for np in nominee_positions %}
|
||||
{% for np in nominee_positions.not_duplicated %}
|
||||
<tr class="{{ forloop.counter|divisibleby:2|yesno:"oddrow,evenrow" }}">
|
||||
{% if is_chair %}
|
||||
<td><input class="batch-select" type="checkbox" value="{{ np.id }}" name="selected"/></td>
|
||||
|
|
|
@ -60,9 +60,9 @@ table.nominees tr td {
|
|||
|
||||
<table class="nominees">
|
||||
{% for p in positions %}
|
||||
{% if p.nomineeposition_set.accepted %}
|
||||
{% if p.nomineeposition_set.accepted.not_duplicated %}
|
||||
<tr><th>{{ p.name }}:</th></tr>
|
||||
{% for np in p.nomineeposition_set.accepted %}
|
||||
{% for np in p.nomineeposition_set.accepted.not_duplicated %}
|
||||
<tr>
|
||||
<td>{% add_num_nominations user np.position np.nominee %}<a href="{% url nomcom_public_feedback year %}?nominee={{np.nominee.id}}&position={{ np.position.id}}">{{ np.nominee.email.person.name }}</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in a new issue