when you fix an error only to get another unrelated one

pull/5/head
tmitche2 2020-03-05 17:25:00 -05:00
parent ad82ae306a
commit ccc377609a
2 changed files with 13 additions and 10 deletions

View File

@ -52,6 +52,7 @@ def index():
#print("PRINTING PAGING HERE")
#print(paging)
results = proc_results(sentTitle)
print(results)
#breaks if there are few results, or if you click on last page
#makes me think there's an issue with a for loop that is rendering the results since the last result won't display?
@ -60,19 +61,21 @@ def index():
def proc_results(r):
print("PRINTING ALL PROC_RESULTS")
print(r)
#print("PRINTING ALL PROC_RESULTS")
#print(r)
return [enhance_results(res) for res in r['data']['results']]
#none type object due to this for loop. why? no clue.
#none type object due to this for loop. why? no clue.
def enhance_results(r):
if r.get('term') == 'renewal':
#print(r)
if r.get('type') == 'renewal':
#print("++++++++++++RENEWAL HERE OK++++++++++")
return r
#print("PRINTING REGISTRATIONS NOW")
print(r.get('registrations'))
print("==============================")
print(r.get("xml"))
# print(r.get('registrations'))
#print("==============================")
#print(r.get("xml"))
return {**r, **{'original': strip_tags(r.get('xml')),
'is_post_1963': is_post_1963(r.get('registrations')),
'is_foreign': is_foreign(r.get('registrations')),
@ -97,7 +100,7 @@ def ia_stream(url):
def is_post_1963(regs):
#print("PRINTING REGS NOW")
print(regs)
#print(regs)
return any([r['date'] > '1963' for r in regs])

View File

@ -1,11 +1,11 @@
<div class = "d-flex"><h3>Registration {{ result['registrations'][0]['number'] }}</h3></div>
<div class = "d-flex"><h3>Registration {{ result['registrations'] }}</h3></div>
<dl>
<div class="row">
<div class="col-sm-6"><b>Title</b></div>
<div class="col-sm-6">{{ result['title'] }}</div>
</div>
</div>
<div class = "row">
<div class="col-sm-6"><b>Authors</b></div>