From b77b2dbdfb68e5cffd03bffb0f65500d2dde15f2 Mon Sep 17 00:00:00 2001 From: tmitche2 Date: Thu, 5 Mar 2020 17:31:40 -0500 Subject: [PATCH] Done with these errors, next action item is to manipulate API --- cce_search/search.py | 20 ++++--------------- .../templates/search/render_registration.html | 6 +----- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/cce_search/search.py b/cce_search/search.py index 3d5545d..b8d39ab 100644 --- a/cce_search/search.py +++ b/cce_search/search.py @@ -24,11 +24,10 @@ def index(): if not arguments: print("NO ARGUMENTS GIVEN. PLEASE GIVE ARGUMENTS") else: - #if request.args.get("title"): - title = request.args['title'] - #print("TITLE HERE") - sentTitle = search(title, request.args.get('page'), - request.args.get('per_page')) + if request.args.get("title"): + title = request.args['title'] + sentTitle = search(title, request.args.get('page'), + request.args.get('per_page')) if request.args.get("renewal"): print("UNIQUE. THERE IS RENEWAL. NEED TO BREAK FROM THIS UNLESS NO RESULTS SHOW") sentAuthor = ren_search(request.args['renewal'], request.args.get('page'), @@ -61,21 +60,12 @@ def index(): def proc_results(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. def enhance_results(r): - #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")) return {**r, **{'original': strip_tags(r.get('xml')), 'is_post_1963': is_post_1963(r.get('registrations')), 'is_foreign': is_foreign(r.get('registrations')), @@ -99,8 +89,6 @@ def ia_stream(url): def is_post_1963(regs): - #print("PRINTING REGS NOW") - #print(regs) return any([r['date'] > '1963' for r in regs]) diff --git a/cce_search/templates/search/render_registration.html b/cce_search/templates/search/render_registration.html index 47fee6f..bedcddd 100644 --- a/cce_search/templates/search/render_registration.html +++ b/cce_search/templates/search/render_registration.html @@ -1,11 +1,7 @@ -

Registration {{ result['registrations'] }}

+

Title: {{ result['title'] }}

-
-
Title
-
{{ result['title'] }}
-
Authors