Skip to content

Commit

Permalink
Use the recently added information about if a parameter is required f…
Browse files Browse the repository at this point in the history
…or asking only for the not initialized parameters when loading a parameterized workspace. See Wirecloud#291
  • Loading branch information
aarranz authored and Alejandro Rodriguez committed Jul 24, 2017
1 parent 7558b87 commit 8b6ef80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/wirecloud/platform/preferences/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def update_workspace_preferences(workspace, preferences_json, invalidate_cache=T
preference = currentPreferences[name]
else:
preference = WorkspacePreference(workspace=workspace, name=name)
changes = pref_changes = True

if isinstance(preference_data, dict):
if 'value' in preference_data and preference.value != preference_data['value']:
Expand Down
1 change: 1 addition & 0 deletions src/wirecloud/platform/workspace/mashupTemplateParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def fillWorkspaceUsingTemplate(workspace, template):
'inheritable': False,
'label': param.get('label'),
'type': param.get('type'),
'required': param.get('required')
})

for tab_entry in mashup_description['tabs']:
Expand Down
2 changes: 1 addition & 1 deletion src/wirecloud/platform/workspace/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def process_forced_values(workspace, user, concept_values, preferences):
param_values = {}
empty_params = []
for param in forced_values['extra_prefs']:
if param['name'] in preferences:
if param['name'] in preferences and (param['required'] is False or preferences[param['name']]['value'].strip() != ''):
param_values[param['name']] = preferences[param['name']]['value']
else:
empty_params.append(param['name'])
Expand Down

0 comments on commit 8b6ef80

Please sign in to comment.