Skip to content

Commit

Permalink
Fixes for #257 #270 #273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijahwalkerwest committed Mar 28, 2018
1 parent 6280df8 commit 3174e72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ function handleActionTypeChange(formType, currentForm) {
addResultButton.insertAfter(currentForm);
addResultForm(addResultButton, true);
}
if ($('form').find('[name="action"]').val() !== 'update' && $(currentForm).find('tbody.results-set').length === 0) {
var addResultButton = $("<tbody class='add-result-btn'><tr><td></td><td><a class='add-result-btn btn btn-default col-xs-12 col-sm-12' onclick='javascript:addResultForm(this)'>+ Add Result</a></td></tr></tbody>");
addResultButton.insertAfter(currentForm);
addResultForm(addResultButton, true);
}
}
if (formType === 'Instrument calibration') {
$(currentForm).find('[name="instrumentoutputvariable"]').parents('tr').addClass('form-required');
Expand Down
10 changes: 3 additions & 7 deletions src/sensordatainterface/views/edit_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ def edit_action(request, action_type, action_id=None, visit_id=None, site_id=Non
)
action_form.results = []

if action_type =='Instrumentdeployment':
if action_type =='instrumentdeployment':
for result in child_action.featureaction.get().result_set.all():
cur_equipment = EquipmentUsed.objects.get(actionid=child_action.actionid)
output_variable = InstrumentOutputVariable.objects.get(
Expand Down Expand Up @@ -1341,12 +1341,8 @@ def edit_retrieval(request, deployment_id=None, retrieval_id=None):

elif deployment_id:
deployment_action = Action.objects.get(pk=deployment_id)
parent_action_id = RelatedAction.objects.get(
relationshiptypecv=child_relationship,
actionid=deployment_id
)
site_visit = Action.objects.get(pk=parent_action_id.relatedactionid.actionid)
site_visit_form = SiteVisitChoiceForm(instance=site_visit)

site_visit_form = SiteVisitChoiceForm()

retrieval_form = ActionForm(
initial={
Expand Down

0 comments on commit 3174e72

Please sign in to comment.