Commit bc27153a authored by Arno Töll's avatar Arno Töll
Browse files

Provide sane defaults for new forms

parent c8d5f37b
...@@ -280,7 +280,12 @@ class MyController(BaseController): ...@@ -280,7 +280,12 @@ class MyController(BaseController):
c.technical_tags = meta.session.query(SponsorTags).filter_by(tag_type=constants.SPONSOR_METRICS_TYPE_TECHNICAL).all() c.technical_tags = meta.session.query(SponsorTags).filter_by(tag_type=constants.SPONSOR_METRICS_TYPE_TECHNICAL).all()
c.social_tags = meta.session.query(SponsorTags).filter_by(tag_type=constants.SPONSOR_METRICS_TYPE_SOCIAL).all() c.social_tags = meta.session.query(SponsorTags).filter_by(tag_type=constants.SPONSOR_METRICS_TYPE_SOCIAL).all()
if not c.metrics: if not c.metrics:
# Set some sane defaults
log.debug("Generating new defaults for sponsor metrics")
c.metrics = SponsorMetrics() c.metrics = SponsorMetrics()
c.metrics.availability = constants.SPONSOR_METRICS_PRIVATE
c.metrics.guidelines = constants.SPONSOR_GUIDELINES_TYPE_NONE
log.debug('Rendering page') log.debug('Rendering page')
return render('/my/index.mako') return render('/my/index.mako')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment