From 9fcb963e76d06ca4f659bc052bb46c3d50f155ce Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 19 Jan 2017 18:14:31 +0200 Subject: Added checkin_enable setting --- servo/models/common.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'servo/models') diff --git a/servo/models/common.py b/servo/models/common.py index 1f9af7c..b2b6c51 100644 --- a/servo/models/common.py +++ b/servo/models/common.py @@ -497,6 +497,7 @@ class Location(models.Model): @classmethod def get_checkin_list(cls): + """List service locations that are marked for check-in.""" results = [] for l in cls.objects.filter(checkin=True): results.append({'pk': l.pk, 'name': l.title}) @@ -651,6 +652,10 @@ class Configuration(models.Model): return config.get(key) if key else config + @classmethod + def checkin_enabled(cls): + return cls.conf('checkin_enable') + def save(self, *args, **kwargs): config = super(Configuration, self).save(*args, **kwargs) # Using cache instead of session since it's shared among -- cgit v1.2.3