mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
* Add more security headers (#458) * Include some missing security headers This change adds the following security headers: * X-Content-Type-Options to prevent content type sniffing * Referrer-Policy to prevent leaking referrer information when navigating away from the instance * Migrate from Docker sample to manual configuration Migrate the additional security headers from the Docker configuration sample to the manual configuration guide. Add DS_Store to gitingore * Show order locale in order details * Add OrderLocaleChange view and OrderLocaleForm Refactor OrderLocaleForm. Add test
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils.formats import localize
|
||||
@@ -118,3 +119,15 @@ class OrderContactForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Order
|
||||
fields = ['email']
|
||||
|
||||
|
||||
class OrderLocaleForm(forms.ModelForm):
|
||||
locale = forms.ChoiceField()
|
||||
|
||||
class Meta:
|
||||
model = Order
|
||||
fields = ['locale']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields['locale'].choices = [(a, a) for a in self.instance.event.settings.locales]
|
||||
|
||||
Reference in New Issue
Block a user