Skip to content

Commit

Permalink
Merge pull request #270 from Mognom/multiuser
Browse files Browse the repository at this point in the history
Fix patch over a variable destroying other variables
  • Loading branch information
aarranz authored Feb 28, 2017
2 parents c4a73d2 + 82be33d commit b77d935
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wirecloud/platform/tests/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,8 @@ def test_workspace_wiring_entry_patch_preference_value(self):

# Check if preferences changed
self.assertEqual(Workspace.objects.get(pk=202).wiringStatus["operators"]["2"]["preferences"]["pref_secure"]["value"]["users"]["4"], "helloWorld")
# Other preferences should not be modified
self.assertEqual(Workspace.objects.get(pk=202).wiringStatus["operators"]["2"]["preferences"]["username"]["value"]["users"]["4"], "test_username")

def test_workspace_wiring_entry_patch_preference_value_read_only_permission(self):
url = reverse('wirecloud.workspace_wiring', kwargs={'workspace_id': 202})
Expand Down
3 changes: 3 additions & 0 deletions src/wirecloud/platform/wiring/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ def checkWiring(self, request, new_wiring_status, old_wiring_status, can_update_
for preference_name in updated_preferences:
old_preference = old_operator['preferences'][preference_name]
new_preference = operator['preferences'][preference_name]
# Using patch means no change at all on non-modified preferences
if old_preference == new_preference:
continue

# Check if its multiuser
if preference_name in operator_preferences:
Expand Down

0 comments on commit b77d935

Please sign in to comment.