rebuild the query for more post structured

This commit is contained in:
Cayo Puigdefabregas 2020-10-27 19:12:46 +01:00
parent 02b18ff115
commit ab1d268f14
1 changed files with 5 additions and 3 deletions

View File

@ -27,11 +27,13 @@ class DeviceDef(Resource):
url_prefix, subdomain, url_defaults, root_path, cli_commands)
device_merge = DeviceMergeView.as_view('merge-devices', definition=self, auth=app.auth)
if self.AUTH:
device_merge = app.auth.requires_auth(device_merge)
self.add_url_rule('/<{}:{}>/merge/'.format(self.ID_CONVERTER.value, self.ID_NAME),
view_func=device_merge,
methods={'POST'})
path = '/<{value}:dev1_id>/merge/<{value}:dev2_id>'.format(value=self.ID_CONVERTER.value)
self.add_url_rule(path, view_func=device_merge, methods={'POST'})
class ComputerDef(DeviceDef):