Include global settings in event/organizer settings

Also, add tests
This commit is contained in:
Tobias Kunze
2016-10-27 10:48:54 +02:00
committed by Raphael Michel
parent c647aa9f4e
commit c5fdf7c215
8 changed files with 62 additions and 17 deletions

View File

@@ -11,6 +11,7 @@ from django.db.models import Model
from django.utils.translation import ugettext_noop
from pretix.base.i18n import LazyI18nString
from pretix.base.models.settings import GlobalSetting
DEFAULTS = {
'max_items_per_order': {
@@ -511,3 +512,10 @@ class SettingsSandbox:
def set(self, key: str, value: Any):
self._event.settings.set(self._convert_key(key), value)
class GlobalSettingsObject:
def __init__(self):
self.settings = SettingsProxy(self, type=GlobalSetting)
self.setting_objects = GlobalSetting.objects
self.slug = 'GLOBALSETTINGS'