Introduce Item.show_quota_left

This commit is contained in:
Raphael Michel
2019-07-10 16:08:21 +02:00
parent 6d6cd3b7cf
commit 491753008d
10 changed files with 63 additions and 7 deletions

View File

@@ -174,7 +174,7 @@ class AddOnsForm(forms.Form):
elif avail[0] < 100:
n += ' {}'.format(_('Currently unavailable'))
else:
if avail[1] is not None and event.settings.show_quota_left:
if avail[1] is not None and item.do_show_quota_left:
n += ' {}'.format(_('%(num)s currently available') % {'num': avail[1]})
if not isinstance(item_or_variation, ItemVariation) and item.picture:
@@ -236,6 +236,7 @@ class AddOnsForm(forms.Form):
to_attr='_subevent_quotas',
queryset=event.quotas.filter(subevent=subevent))
).distinct()),
'event'
).annotate(
quotac=Count('quotas'),
has_variations=Count('variations')