-
Notifications
You must be signed in to change notification settings - Fork 18
/
signals.py
62 lines (56 loc) · 2.26 KB
/
signals.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from collections import OrderedDict
from django import forms
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from pretix.base.signals import (
register_global_settings, register_ticket_outputs,
)
from .forms import CertificateFileField, validate_rsa_privkey
@receiver(register_ticket_outputs, dispatch_uid='output_passbook')
def register_ticket_output(sender, **kwargs):
from .passbook import PassbookOutput
return PassbookOutput
@receiver(register_global_settings, dispatch_uid='passbook_settings')
def register_global_settings(sender, **kwargs):
return OrderedDict([
('passbook_team_id', forms.CharField(
label=_('Passbook team ID'),
required=False,
)),
('passbook_pass_type_id', forms.CharField(
label=_('Passbook type'),
required=False,
)),
('passbook_organizer_name', forms.CharField(
label=_('Passbook organizer name'),
required=False,
)),
('passbook_certificate_file', CertificateFileField(
label=_('Passbook certificate file'),
required=False,
)),
('passbook_wwdr_certificate_file', CertificateFileField(
label=_('Passbook CA Certificate'),
help_text=_('You can download the current CA certificate from apple at '
'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer'),
required=False,
)),
('passbook_key', forms.CharField(
label=_('Passbook secret key'),
required=False,
widget=forms.Textarea,
validators=[validate_rsa_privkey]
)),
('passbook_key_password', forms.CharField(
label=_('Passbook key password'),
widget=forms.PasswordInput(render_value=True),
required=False,
help_text=_('Optional, only necessary if the key entered above requires a password to use.')
)),
('passbook_gmaps_api_key', forms.CharField(
label=_('Google Maps API key'),
widget=forms.PasswordInput(render_value=True),
required=False,
help_text=_('Optional, only necessary to find coordinates automatically.')
)),
])