Unify all calls to register_payment_providers

This commit is contained in:
Raphael Michel
2017-06-29 12:09:48 +02:00
parent d5d1fcf331
commit 2add8d671a
11 changed files with 48 additions and 90 deletions

View File

@@ -313,6 +313,19 @@ class Event(LoggedModel):
event_copy_data.send(sender=self, other=other)
def get_payment_providers(self) -> dict:
from ..signals import register_payment_providers
responses = register_payment_providers.send(self)
providers = {}
for receiver, response in responses:
if not isinstance(response, list):
response = [response]
for p in response:
pp = p(self)
providers[pp.identifier] = pp
return providers
def generate_invite_token():
return get_random_string(length=32, allowed_chars=string.ascii_lowercase + string.digits)