Skip to content
Snippets Groups Projects
Commit 27eadeaa authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch '35-fix-template-not-being-able-to-access-paymentvariant-name' into 'master'

Fix template not being able to access PaymentVariant name

Closes #35

See merge request !86
parents c9884dda daa49618
No related branches found
No related tags found
1 merge request!86Fix template not being able to access PaymentVariant name
Pipeline #197090 passed with warnings
......@@ -38,6 +38,10 @@ class PaymentVariant(RegistryObject, ExtensiblePolymorphicModel):
(variant._class_name, variant.verbose_name) for variant in cls.registered_objects_list
]
@classproperty
def variant_name(cls):
return cls._class_name
class Meta:
verbose_name = _("Payment variant")
verbose_name_plural = _("Payment variants")
......
......@@ -76,7 +76,7 @@
<td>
<select name="variant" {% if not can_change_variant %}disabled{% endif %}>
{% for payment_variant in object.group.client.payment_variants.all %}
<option value="{{ payment_variant._class_name }}" {% if object.variant == payment_variant._class_name %}selected{% endif %}>{{ payment_variant.verbose_name }}</option>
<option value="{{ payment_variant.variant_name }}" {% if object.variant == payment_variant.variant_name %}selected{% endif %}>{{ payment_variant.verbose_name }}</option>
{% endfor %}
</select>
</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment