Skip to content

Commit

Permalink
Merge pull request #5062 from dimagi/pass-commcare-version
Browse files Browse the repository at this point in the history
Pass version feature flags to vellum
  • Loading branch information
millerdev committed Jan 5, 2015
2 parents 294862f + cea7536 commit 69c34e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions corehq/apps/app_manager/feature_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ def enable_offline_install(self):
@property
def enable_auto_gps(self):
return self._require_minimum_version('2.14')

@property
def enable_group_in_field_list(self):
"""
Groups and repeat groups inside of a field list supported by apps
version 2.16 or higher
"""
return self._require_minimum_version('2.16')
9 changes: 7 additions & 2 deletions corehq/apps/app_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,12 @@ def form_designer(req, domain, app_id, module_id=None, form_id=None,
))
return back_to_main(req, domain, app_id=app_id,
unique_form_id=form.unique_id)

vellum_features = toggles.toggles_dict(username=req.user.username,
domain=domain)
vellum_features.update({
'group_in_field_list': app.enable_group_in_field_list
})
context = get_apps_base_context(req, domain, app)
context.update(locals())
context.update({
Expand All @@ -1156,8 +1162,7 @@ def form_designer(req, domain, app_id, module_id=None, form_id=None,
'formdesigner': True,
'multimedia_object_map': app.get_object_map(),
'sessionid': req.COOKIES.get('sessionid'),
'features': toggles.toggles_dict(username=req.user.username,
domain=domain)
'features': vellum_features
})
return render(req, 'app_manager/form_designer.html', context)

Expand Down

0 comments on commit 69c34e5

Please sign in to comment.