Skip to content
Snippets Groups Projects
Verified Commit cdecf453 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add Invoice.get_variant_choices

parent 7fd94a7f
No related branches found
No related tags found
No related merge requests found
Pipeline #59274 canceled
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
......@@ -50,6 +51,13 @@ class Invoice(BasePayment, PureDjangoModel):
for_object_id = models.PositiveIntegerField()
for_object = GenericForeignKey("for_content_type", "for_object_id")
@classmethod
def get_variant_choices(cls):
choices = []
for variant in settings.PAYMENT_VARIANTS.keys():
choices.append((variant, cls.VARIANT_DISPLAY[self.variant][0]))
return choices
def get_variant_name(self):
return self.__class__.VARIANT_DISPLAY[self.variant][0]
......
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