Jaap Joris Vens 2020-03-19 21:48:03 +01:00
rodzic 2332740cf9
commit 2b9c9d9a14
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -132,7 +132,7 @@ class SectionForm(forms.ModelForm):
class ContactForm(forms.Form):
sender = forms.EmailField(label=_('Your email address'))
spam_protection = forms.CharField(label=_('Your message'), widget=forms.Textarea())
message = forms.CharField(label=_('Your message'), widget=forms.Textarea(attrs={'class': 'ftp'}), initial='Hi there!')
message = forms.CharField(label=_('Your message'), widget=forms.Textarea(), initial='Hi there!')
def save(self, request):
hostname = request.get_host()
@ -144,7 +144,7 @@ class ContactForm(forms.Form):
return
email = EmailMessage(
to = settings.DEFAULT_TO_EMAIL,
to = [settings.DEFAULT_TO_EMAIL],
body = body,
subject = _('Contact form at %(hostname)s.') % {'hostname': hostname},
headers = {'Reply-To': self.cleaned_data.get('sender')},

Wyświetl plik

@ -9,7 +9,7 @@ except ImportError:
PROJECT_NAME = 'example'
KEYFILE = f'/tmp/{PROJECT_NAME}.secret'
ADMINS = [('JJ Vens', 'jj@rtts.eu')]
DEFAULT_TO_EMAIL = ADMINS
DEFAULT_TO_EMAIL = 'jj@rtts.eu'
ALLOWED_HOSTS = ['*']
ROOT_URLCONF = 'project.urls'
WSGI_APPLICATION = 'project.wsgi.application'