Skip to content

Commit

Permalink
Add temporary logging to examine CPI parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Doupe committed Feb 28, 2018
1 parent 0a27327 commit cd12b66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions webapp/apps/taxbrain/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ def __init__(self, first_year, *args, **kwargs):
# https://www.pydanny.com/overloading-form-fields.html
self.fields.update(self.Meta.update_fields)

print('SS_Earnings_c_cpi field', self.fields['SS_Earnings_c_cpi'].__dict__)
print('SS_Earnings_c_cpi widget', self.fields['SS_Earnings_c_cpi'].widget.__dict__)
print('SS_Earnings_c_cpi meta widget', self._meta.widgets['SS_Earnings_c_cpi'].__dict__)

def clean(self):
"""
" This method should be used to provide custom model validation, and to
Expand Down
6 changes: 4 additions & 2 deletions webapp/apps/taxbrain/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ def personal_results(request):
has_errors = False
use_puf_not_cps = True
if request.method=='POST':
print('method=POST get', request.GET)
print('method=POST post', request.POST)
obj, _, has_errors, _ = process_reform(request)

# case where validation failed in forms.TaxBrainForm
Expand All @@ -456,8 +458,8 @@ def personal_results(request):

else:
# Probably a GET request, load a default form
print('get get', request.GET)
print('get post', request.POST)
print('method=GET get', request.GET)
print('method=GET post', request.POST)
params = parse_qs(urlparse(request.build_absolute_uri()).query)
if 'start_year' in params and params['start_year'][0] in START_YEARS:
start_year = params['start_year'][0]
Expand Down

0 comments on commit cd12b66

Please sign in to comment.