Skip to content

Commit

Permalink
fix if we don't have a prefilled user objecte
Browse files Browse the repository at this point in the history
  • Loading branch information
bgruening committed Aug 12, 2016
1 parent 320f17b commit ff9f39a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 2 additions & 6 deletions client/galaxy/scripts/mvc/user/extra-information.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ var ExtraInformation = Backbone.View.extend({
item_object = data["preferences"][item];
// sets the model for each plugin data and
// values to each input field
if( item_object["name"] === "section_apollo_url" ) {
model = plugins["section_apollo_url"];
}
else if( item_object["name"] === "section_openstack_account" ) {
model = plugins["section_openstack_account"];
}

model = item_object["name"];

template = template + '<div class="form-row '+ item_object["name"] +' ">';
template = template + "<label>" + item_object["description"] + ":</label>";
Expand Down
5 changes: 3 additions & 2 deletions lib/galaxy/webapps/galaxy/api/user_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,11 @@ def get_extra_preferences( self, trans, cntrller='user_preferences', **kwd ):
with open(path, 'r') as stream:
config = load(stream)
except:
log.warn('Config file (%s) could not be found or is malformed.' % path)
log.error('Config file (%s) could not be found or is malformed.' % path)

user = trans.user
plugin_data = user.preferences.get("dynamic_user_preferences", {})
plugin_data = user.preferences.get("dynamic_user_preferences", '{}')
log.warn(plugin_data)
# deserializes the json and returns to the client
return { "config": config,
"plugins": json.loads(plugin_data)
Expand Down

0 comments on commit ff9f39a

Please sign in to comment.