Skip to content

Commit

Permalink
Merge branch 'feature/root-wo-rename-warning' into develop
Browse files Browse the repository at this point in the history
 [SVCS-397]
 Closes: #305
  • Loading branch information
felliott committed Dec 12, 2017
2 parents 134dfdf + d02bc58 commit bd753ab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions waterbutler/server/api/v1/provider/movecopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ async def move_or_copy(self):
if path is None:
raise exceptions.InvalidParameters('"path" field is required for moves or copies')
if not path.endswith('/'):
raise exceptions.InvalidParameters('"path" field requires a trailing slash to '
'indicate it is a folder')
raise exceptions.InvalidParameters(
'"path" field requires a trailing slash to indicate it is a folder'
)

# TODO optimize for same provider and resource

# for copy action, `auth_action` is the same as `provider_action`
if auth_action == 'copy' and self.path.is_root and not self.json.get('rename'):
raise exceptions.InvalidParameters('"rename" field is required for copying root')

# Note: attached to self so that _send_hook has access to these
self.dest_resource = self.json.get('resource', self.resource)
self.dest_auth = await auth_handler.get(
Expand Down

0 comments on commit bd753ab

Please sign in to comment.