Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
filak committed Nov 16, 2023
1 parent 404e6ba commit c061248
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
6 changes: 2 additions & 4 deletions flask-app/application/modules/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ def validateRequest(scope=None, token=None):
if not token:
if request.method == 'GET':
token = request.args.get('token')
elif request.is_json:
data = request.get_json()
token = data.get('token')
else:

if not token:
token = request.headers.get(WORKER_TOKEN_HEADER)

if not token:
Expand Down
2 changes: 1 addition & 1 deletion flask-app/application/modules/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ def update_stats(stat):
if anglo_style in ['yes','no']:
params['marc']['anglo_style'] = anglo_style

mtu.callWorker(export=stat)
mtu.callWorker(export=stat, params=params)

elif stat in ['initial','actual','all','duplicates','lookups','lookups_rest']:

Expand Down
12 changes: 8 additions & 4 deletions flask-app/application/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ def getStatsFpath(stat, ext='json', params={}, target_year=None):

if ext == 'marc':
ext = params.get('tree_style','') + '.txt'
stat += '_' + params.get('line_style')
stat += '_' + params.get('line_style','')

if not target_year:
target_year = app.config['TARGET_YEAR']
Expand Down Expand Up @@ -1745,7 +1745,7 @@ def getCharMap(char_list):
return char_map


def callWorker(export=None, stat=None, force=False):
def callWorker(export=None, stat=None, force=False, params=None):
worker = app.config['WORKER_HOST'].strip('/')
endpoint = None

Expand All @@ -1758,8 +1758,12 @@ def callWorker(export=None, stat=None, force=False):
if force:
endpoint += '?force=1'

bauth = app.config.get('API_AUTH_BASIC', None)
bauth = app.config.get('API_AUTH_BASIC', None)
headers = genApiHeaders( data=getReqHost() )

if endpoint:
fsession.post(endpoint, headers=genApiHeaders(data=getReqHost()), auth=bauth)
fsession.post(endpoint,
headers=headers,
auth=bauth,
json=params)

2 changes: 1 addition & 1 deletion flask-app/application/templates/manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ <h5>Base Exports<small class="text-success"> [generate to enable more exports]</

<ul class="list-inline mb-2">
<li class="list-inline-item">
<h4>MARC21 Exports</h4>
<h4>MARC21</h4>
</li>
<li class="list-inline-item float-right">
</li>
Expand Down

0 comments on commit c061248

Please sign in to comment.