Skip to content
Snippets Groups Projects
Commit a928783d authored by Maël Méliani's avatar Maël Méliani
Browse files

Fixed some bugs about mandatory data params when POST and PUT method used.

parent bf88f16b
No related branches found
No related tags found
No related merge requests found
...@@ -143,7 +143,7 @@ class datastores(object): ...@@ -143,7 +143,7 @@ class datastores(object):
def POST(self, map_name, ws_name, format): def POST(self, map_name, ws_name, format):
mf, ws = get_mapfile_workspace(map_name, ws_name) mf, ws = get_mapfile_workspace(map_name, ws_name)
data = get_data(name="dataStore", mandatory=["name", "connectionParameters"]) data = get_data(name="dataStore", mandatory=["name"])
ds_name = data.pop("name") ds_name = data.pop("name")
with webapp.mightConflict("dataStore", workspace=ws_name): with webapp.mightConflict("dataStore", workspace=ws_name):
...@@ -170,7 +170,7 @@ class datastore(object): ...@@ -170,7 +170,7 @@ class datastore(object):
def PUT(self, map_name, ws_name, ds_name, format): def PUT(self, map_name, ws_name, ds_name, format):
mf, ws = get_mapfile_workspace(map_name, ws_name) mf, ws = get_mapfile_workspace(map_name, ws_name)
data = get_data(name="dataStore", mandatory=["name", "connectionParameters"], forbidden=["href"]) data = get_data(name="dataStore", mandatory=["name"], forbidden=["href"])
if ds_name != data.pop("name"): if ds_name != data.pop("name"):
raise webapp.Forbidden("Can't change the name of a data store.") raise webapp.Forbidden("Can't change the name of a data store.")
...@@ -479,7 +479,7 @@ class files(object): ...@@ -479,7 +479,7 @@ class files(object):
z.extract(f, path=tools.get_st_data_path(ws_name, st_type, st_name)) z.extract(f, path=tools.get_st_data_path(ws_name, st_type, st_name))
# Set new connection parameters: # Set new connection parameters:
ws.update_store(st_type, st_name, {"ConnectionParameters":{"path":path}}) ws.update_store(st_type, st_name, {"connectionParameters":{"path":path}})
ws.save() ws.save()
# Finally we might have to configure it. # Finally we might have to configure it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment