Fixing min amounts in assignment meta info

This commit is contained in:
Sean 2020-12-14 16:29:15 +01:00 committed by Finn Stutzenstein
parent 7e763e8c07
commit 0b01b5576b
No known key found for this signature in database
GPG Key ID: 9042F605C6324654
2 changed files with 21 additions and 2 deletions

View File

@ -32,10 +32,26 @@
<small *ngIf="poll.pollmethod">
<span> {{ 'Voting method' | translate }}: {{ poll.pollmethodVerbose | translate }} </span>
<!-- amount of votes -->
<span *ngIf="poll.votes_amount > 1"> ({{ poll.votes_amount }} {{ 'Votes' | translate }})</span>
<!-- <span *ngIf="poll.max_votes_amount > 1"> ({{ poll.max_votes_amount }} {{ 'Votes' | translate }})</span>
<span *ngIf="poll.max_votes_amount > 1"> ({{ poll.max_votes_amount }} {{ 'Votes' | translate }})</span> -->
<br />
</small>
<!-- Amount of Votes -->
<small *ngIf="poll.max_votes_amount > 1">
<ng-container *ngIf="poll.max_votes_amount !== poll.min_votes_amount">
<span> {{ pollPropertyVerbose.max_votes_amount | translate }}: {{ poll.max_votes_amount }}</span>
<br />
<span> {{ pollPropertyVerbose.min_votes_amount | translate }}: {{ poll.min_votes_amount }}</span>
<br />
</ng-container>
<ng-container *ngIf="poll.max_votes_amount === poll.min_votes_amount">
<span> {{ 'Votes' | translate }}: {{ poll.max_votes_amount }} </span>
<br />
</ng-container>
</small>
<!-- 100% base -->
<small *ngIf="poll.onehundred_percent_base">
{{ '100% base' | translate }}: {{ poll.percentBaseVerbose | translate }}

View File

@ -378,8 +378,11 @@ class AssignmentPoll(RESTModelMixin, BasePoll):
decimal_places=6,
)
min_votes_amount = models.IntegerField(default=1, validators=[MinValueValidator(1)])
""" For "votes" mode: The min amount of votes a voter can give. """
max_votes_amount = models.IntegerField(default=1, validators=[MinValueValidator(1)])
""" For "votes" mode: The amount of votes a voter can give. """
""" For "votes" mode: The max amount of votes a voter can give. """
allow_multiple_votes_per_candidate = models.BooleanField(default=False)