Permalink
Browse files

sample_set.py, sample_set/custom.html fix issues with helper instance

there were a couple issues with calls to in non-existant helper
instance, so now we have an instance to work with
  • Loading branch information...
RyanHerb committed Sep 7, 2017
1 parent 277b72a commit 8a2b182a834b320237099a413cc003296155510e
@@ -334,7 +334,11 @@ def custom():
request.vars["custom_list"] = [request.vars["custom_list"]]
myGroupBy = None
helper = None
if request.vars["id"] and auth.can_view_sample_set(request.vars["id"]):
sample_set = db.sample_set[request.vars["id"]]
factory = ModelFactory()
helper = factory.get_instance(type=sample_set.sample_type)
q = ((auth.vidjil_accessible_query(PermissionEnum.read_config.value, db.config))
& (db.sample_set.id == request.vars["id"])
& (db.sample_set_membership.sample_set_id == db.sample_set.id)
@@ -403,7 +407,8 @@ def custom():
return dict(query=query,
config_id=config_id,
config=config)
config=config,
helper=helper)
def confirm():
if auth.can_modify_sample_set(request.vars["id"]):
@@ -6,7 +6,7 @@
<div>
{{ if request.vars['id']: }}
<h3>Compare samples from {{=helper.get_type_display()}} {{=helper.get_name(request.vars['id'])}}</h3>
<h3>Compare samples from {{=helper.get_type_display()}} {{=get_sample_name(request.vars["id"])}}</h3>
{{ else: }}
<h3>Compare samples</h3>
{{pass}}
@@ -50,7 +50,7 @@ <h3>Compare samples</h3>
<table class="db_table table_compare" id="table">
<thead>
<tr><td class="column5"> </td>
<td class="column_200"> {{=helper.get_type_display()}} </td>
<td class="column_200"> {{=helper.get_type_display() if helper is not None else "name"}} </td>
<td class="column_200"> file name </td>
<td class="column_100"> sampling date </td>
<td> info </td>

0 comments on commit 8a2b182

Please sign in to comment.