forked from CGM_Public/pretix_original
Enforce start and end time of presale (#15)
This commit is contained in:
@@ -482,6 +482,20 @@ class Event(Versionable):
|
||||
"""
|
||||
return SettingsProxy(self, type=EventSetting, parent=self.organizer)
|
||||
|
||||
@property
|
||||
def presale_has_ended(self):
|
||||
if self.presale_end and now() > self.presale_end:
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def presale_is_running(self):
|
||||
if self.presale_start and now() < self.presale_start:
|
||||
return False
|
||||
if self.presale_end and now() > self.presale_end:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class EventPermission(Versionable):
|
||||
"""
|
||||
|
||||
@@ -41,6 +41,14 @@ DEFAULTS = {
|
||||
'default': 'True',
|
||||
'type': bool
|
||||
},
|
||||
'presale_start_show_date': {
|
||||
'default': 'True',
|
||||
'type': bool
|
||||
},
|
||||
'show_items_outside_presale_period': {
|
||||
'default': 'True',
|
||||
'type': bool
|
||||
},
|
||||
'timezone': {
|
||||
'default': settings.TIME_ZONE,
|
||||
'type': str
|
||||
|
||||
Reference in New Issue
Block a user