clearwing

changeset 226:163151c72008

Fixing code to work with latest Firethorn release
author Stelios <stv@roe.ac.uk>
date Sun Aug 26 23:48:46 2018 +0300 (2018-08-26)
parents 62245bc577d1
children 0806f277e09b
files src/freeform_sql/misc.py src/url_classes/dbaccess_LEGACY_form.py
line diff
     1.1 --- a/src/freeform_sql/misc.py	Sun Aug 26 16:57:46 2018 +0300
     1.2 +++ b/src/freeform_sql/misc.py	Sun Aug 26 23:48:46 2018 +0300
     1.3 @@ -878,8 +878,10 @@
     1.4          if row_length>0:
     1.5              cols = list(cols)
     1.6              content=''
     1.7 -            tap_endpoint=get_info(query_results_id)["results"]["table"]
     1.8 -            tap_endpoint=get_parent_workspace(get_parent_workspace(tap_endpoint))
     1.9 +            if (tap_endpoint.lower().startswith("http")):
    1.10 +                tap_endpoint=get_info(query_results_id)["results"]["table"]
    1.11 +                tap_endpoint=get_parent_workspace(get_parent_workspace(tap_endpoint))
    1.12 +
    1.13              if tap_endpoint!="" and query!="" and mode=='adql':
    1.14                  content = '<div class="sub_button toggle_metadata"><a id="toggle_metadata">Metadata</a></div><span style="height:33px;text-align:left;float:right;font-size:12px;color:#C2BEAD">Query ID <a id="toggle_query_info">[+]</a><a id="toggle_query_info_help">[?]</a><br/><span id="toggle_query_info_div" style="display:none">'+ query_results_id.split("/")[-1]  + '</span></span>'
    1.15                  content += '<form style="float:right;margin-right:120px;z-index:100;position: relative;" class="launch_viewer" action="' + survey_prefix + '/viewer" method="post" target="_blank"><input type="hidden" name="query" value="'+ string_functions.encode(query) +'"/><input type="hidden" name="cols" value="'+ html_functions.escape(json.dumps(cols)) +'"/><input type="hidden" name="filepath" id="temp_file" value="'+ pathname +'"/><input type="hidden" name="tap_endpoint" value="'+ tap_endpoint +'"/>'
     2.1 --- a/src/url_classes/dbaccess_LEGACY_form.py	Sun Aug 26 16:57:46 2018 +0300
     2.2 +++ b/src/url_classes/dbaccess_LEGACY_form.py	Sun Aug 26 23:48:46 2018 +0300
     2.3 @@ -71,7 +71,7 @@
     2.4                  exclude_schema_alias =  config.PRIVATE_SURVEY_DB 
     2.5                  atlasschema = atlasprivate
     2.6              try :
     2.7 -                req_exc = urllib2.Request( atlasschema, headers={"Accept" : "application/json", "firethorn.auth.identity" : session.get("email","unknown user"), "firethorn.auth.community" : session.get("community_input","public (unknown)")})
     2.8 +                req_exc = urllib2.Request(atlasschema,headers={"Accept" : "application/json", "firethorn.auth.identity" : session.get("email","unknown user"), "firethorn.auth.community" : config.firethorn_admin_community, "firethorn.auth.username" : config.firethorn_admin_username, "firethorn.auth.password" : config.firethorn_admin_password})  
     2.9                  response_exc = urllib2.urlopen(req_exc) 
    2.10                  response_exc_json = response_exc.read()
    2.11                  exclude_schema_name = json.loads(response_exc_json)["fullname"]