mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user