Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Doupe committed Sep 18, 2017
1 parent c371d33 commit 369d182
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions webapp/apps/dynamic/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def edit_dynamic_behavioral(request, pk):
'form': form_personal_exemp,
'params': behavior_default_params,
'taxcalc_version': taxcalc_vers_disp,
'webapp_vers_disp': webapp_vers_disp,
'webapp_version': webapp_vers_disp,
'start_year': str(start_year),
'pk': model.micro_sim.pk
}
Expand Down Expand Up @@ -501,7 +501,7 @@ def edit_dynamic_elastic(request, pk):
'form': form_personal_exemp,
'params': elasticity_default_params,
'taxcalc_version': taxcalc_vers_disp,
'webapp_vers': webapp_vers_disp,
'webapp_version': webapp_vers_disp,
'start_year': str(start_year),
'pk': model.micro_sim.pk
}
Expand Down Expand Up @@ -755,7 +755,6 @@ def behavior_results(request, pk):
'webapp_version': webapp_vers_disp}

model = url.unique_inputs

if model.tax_result:

output = model.tax_result
Expand Down Expand Up @@ -840,7 +839,6 @@ def behavior_results(request, pk):
exp_num_minutes = round(exp_num_minutes, 2)
exp_num_minutes = exp_num_minutes if exp_num_minutes > 0 else 0
if exp_num_minutes > 0:
print(context)
return JsonResponse({'eta': exp_num_minutes}, status=202)
else:
return JsonResponse({'eta': exp_num_minutes}, status=200)
Expand Down
5 changes: 3 additions & 2 deletions webapp/apps/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ def get_version(url_obj, attr_name, current_version):
get formatted python version of library for diplay on web page
"""
# need to chop off the commit reference on older runs
vers_disp = (getattr(url_obj, attr_name)
if getattr(url_obj, attr_name) else current_version)
vers_disp = (getattr(url_obj, attr_name)
if getattr(url_obj, attr_name) is not None
else current_version)
# only recently start storing webapp version. for older runs display
# the current version. an alternative is to display the first stable
# version if url.webapp_version is None
Expand Down
4 changes: 2 additions & 2 deletions webapp/apps/taxbrain/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,9 @@ def output_detail(request, pk):
exp_num_minutes = round(exp_num_minutes, 2)
exp_num_minutes = exp_num_minutes if exp_num_minutes > 0 else 0
if exp_num_minutes > 0:
return JsonResponse({'eta': '100'}, status=202)
return JsonResponse({'eta': exp_num_minutes}, status=202)
else:
return JsonResponse({'eta': '100'}, status=200)
return JsonResponse({'eta': exp_num_minutes}, status=200)

else:
context = {'eta': '100'}
Expand Down

0 comments on commit 369d182

Please sign in to comment.