Payment providers: Add priority flag

This commit is contained in:
Raphael Michel
2019-11-15 09:29:38 +01:00
parent ac2ff6c2aa
commit 00798d9207
3 changed files with 14 additions and 1 deletions

View File

@@ -632,7 +632,9 @@ class Event(EventMixin, LoggedModel):
pp = p(self)
providers[pp.identifier] = pp
self._cached_payment_providers = OrderedDict(sorted(providers.items(), key=lambda v: str(v[1].verbose_name)))
self._cached_payment_providers = OrderedDict(sorted(
providers.items(), key=lambda v: (-v[1].priority, str(v[1].verbose_name))
))
return self._cached_payment_providers
def get_html_mail_renderer(self):