mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-12 23:27:22 +00:00
Payment/Manual: Add more ID placeholders
This commit is contained in:
parent
7fb07eb5f3
commit
378a127a5f
@ -8,6 +8,10 @@ integration with Indico.
|
||||
|
||||
## Changelog
|
||||
|
||||
### 3.1
|
||||
|
||||
- Add placeholders for the registration form id and the registration's database id
|
||||
|
||||
### 3.0
|
||||
|
||||
- Initial release for Indico 3.0
|
||||
|
||||
@ -55,6 +55,24 @@ class RegistrationIDPlaceholder(IDPlaceholder):
|
||||
name = 'registration_id'
|
||||
|
||||
|
||||
class RegistrationDatabaseIDPlaceholder(Placeholder):
|
||||
name = 'registration_db_id'
|
||||
description = _("The database ID of the registration")
|
||||
|
||||
@classmethod
|
||||
def render(cls, regform, registration):
|
||||
return registration.id
|
||||
|
||||
|
||||
class RegistrationFormIDPlaceholder(Placeholder):
|
||||
name = 'registration_form_id'
|
||||
description = _("The ID of the registration form")
|
||||
|
||||
@classmethod
|
||||
def render(cls, regform, registration):
|
||||
return registration.registration_form.id
|
||||
|
||||
|
||||
class EventIDPlaceholder(Placeholder):
|
||||
name = 'event_id'
|
||||
description = _("The ID of the event")
|
||||
|
||||
@ -64,11 +64,14 @@ class ManualPaymentPlugin(PaymentPluginMixin, IndicoPlugin):
|
||||
def _get_details_placeholders(self, sender, regform, registration, **kwargs):
|
||||
from indico_payment_manual.placeholders import (CurrencyPlaceholder, EmailPlaceholder, EventIDPlaceholder,
|
||||
FirstNamePlaceholder, LastNamePlaceholder, PricePlaceholder,
|
||||
RegistrationIDPlaceholder)
|
||||
RegistrationDatabaseIDPlaceholder,
|
||||
RegistrationFormIDPlaceholder, RegistrationIDPlaceholder)
|
||||
yield FirstNamePlaceholder
|
||||
yield LastNamePlaceholder
|
||||
yield EmailPlaceholder
|
||||
yield RegistrationIDPlaceholder
|
||||
yield RegistrationDatabaseIDPlaceholder
|
||||
yield RegistrationFormIDPlaceholder
|
||||
yield EventIDPlaceholder
|
||||
yield PricePlaceholder
|
||||
yield CurrencyPlaceholder
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = indico-plugin-payment-manual
|
||||
version = 3.0
|
||||
version = 3.1
|
||||
description = Payment plugin for Indico that can be used for custom payment information/links
|
||||
long_description = file: README.md
|
||||
long_description_content_type = text/markdown; charset=UTF-8; variant=GFM
|
||||
@ -20,7 +20,7 @@ zip_safe = false
|
||||
include_package_data = true
|
||||
python_requires = ~=3.9.0
|
||||
install_requires =
|
||||
indico>=3.0
|
||||
indico>=3.1
|
||||
|
||||
[options.entry_points]
|
||||
indico.plugins =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user