Convert firstboot pages to Django forms

This commit is contained in:
Sunil Mohan Adapa committed 2014-05-11 21:24:36 +05:30
1 parent 5461694b10
commit b50a99b1e4
5 files changed
+255 -102

No files matched your search

+6 -1
View File
@@ -37,6 +37,11 @@ from plugin_mount import PagePlugin
import util
def get_hostname():
"""Return the hostname"""
return socket.gethostname()
class TrimmedCharField(forms.CharField):
"""Trim the contents of a CharField"""
def clean(self, value):
@@ -122,7 +127,7 @@ class Configuration(PagePlugin):
@staticmethod
def get_status():
"""Return the current status"""
return {'hostname': socket.gethostname(),
return {'hostname': get_hostname(),
'time_zone': util.slurp('/etc/timezone').rstrip()}
@staticmethod