Fixed up the setup-app procedure to bypass pulling a theme.

This commit is contained in:
Raoul Snyman 2010-01-18 22:04:49 +02:00
parent df8bd84520
commit f85297a5d2
2 changed files with 10 additions and 9 deletions

View File

@ -20,12 +20,12 @@ def load_environment(global_conf, app_conf):
engine = engine_from_config(app_conf, 'sqlalchemy.')
init_model(engine)
# Pull out theme variable
theme = Session.query(Variable).get(u'theme')
if theme:
theme_name = theme.value
else:
theme_name = None
theme_name = None
if not app_conf.get('setup-app'):
# Pull out theme variable
theme = Session.query(Variable).get(u'theme')
if theme:
theme_name = theme.value
# Set up Pylons paths
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

View File

@ -32,6 +32,7 @@ log = logging.getLogger(__name__)
def setup_app(command, conf, vars):
"""Place any commands to setup scribeengine here"""
conf.local_conf['setup-app'] = True
load_environment(conf.global_conf, conf.local_conf)
import hashlib
@ -56,10 +57,10 @@ def setup_app(command, conf, vars):
role_admin = Role(name=u'Administrator')
role_admin.permissions.extend([perm_addposts, perm_editmyposts, perm_delmyposts])
password = unicode(hmac.new(conf[u'security.salt'], u'omigosh',
password = unicode(hmac.new(conf[u'security.salt'], u'password',
hashlib.sha256).hexdigest(), u'utf-8')
user = User(email=u'raoul.snyman@saturnlaboratories.co.za',
password=password, nick=u'raoul')
user = User(email=u'admin@scribeengine.org',
password=password, nick=u'admin')
user.roles.append(role_admin)
Session.add_all([blog_title, blog_slogan, user])