Skip to content

Commit

Permalink
Really old runs (pre TC 0.6) didn't have start years
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Doupe committed Feb 27, 2018
1 parent 6d5d094 commit 045d032
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion webapp/apps/taxbrain/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import six
import json

from ..constants import START_YEAR

from .models import TaxSaveInputs
from .helpers import (TaxCalcField, TaxCalcParam, default_policy, is_number,
int_to_nth, is_string, string_to_float_array, check_wildcards,
Expand Down Expand Up @@ -164,7 +166,8 @@ def __init__(self, first_year, *args, **kwargs):
k
)
self._meta.widgets[k].attrs["placeholder"] = django_val

if first_year is None:
first_year = START_YEAR
self._first_year = int(first_year)
self._default_params = default_policy(self._first_year)

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 @@ -577,11 +577,11 @@ def edit_personal_results(request, pk):

init_context = {
'form': form_personal_exemp,
'params': nested_form_parameters(int(start_year)),
'params': nested_form_parameters(int(form_personal_exemp._first_year)),
'taxcalc_version': taxcalc_vers_disp,
'webapp_version': webapp_vers_disp,
'start_years': START_YEARS,
'start_year': str(start_year),
'start_year': str(form_personal_exemp._first_year),
'is_edit_page': True,
'has_errors': False
}
Expand Down

0 comments on commit 045d032

Please sign in to comment.