Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
vidboda committed Jul 6, 2023
1 parent 0c85acc commit 106854d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion MobiDetailsApp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,6 @@ def api_variant_create(variant_chgvs=None, caller='browser', api_key=None):
)
db = get_db()
curs = db.cursor(cursor_factory=psycopg2.extras.DictCursor)
print(g.user)
if not g.user:
# external API call - or non-connected user on webUI
res_check_api_key = md_utilities.check_api_key(db, md_utilities.get_post_param(request, 'api_key'))
Expand Down
5 changes: 1 addition & 4 deletions MobiDetailsApp/md_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2424,10 +2424,7 @@ def check_api_key(db, api_key=None): # in api
return {'mobidetails_error': 'Bad chars in API key'}
elif request.referrer is not None and \
(url_parse(request.referrer).host == host['dev'] or
url_parse(request.referrer).host == host['prod']):# and \
# url_parse(request.referrer).path != 'MDAPI':

print(url_parse(request.referrer).path)
url_parse(request.referrer).host == host['prod']):
return {'mobiuser': get_api_key(curs, None, 'user_object')}
return {'mobidetails_error': 'No API key provided'}

Expand Down

0 comments on commit 106854d

Please sign in to comment.