From 46ef153d4bda44b4d91f3c11e91c2c978b1a76ac Mon Sep 17 00:00:00 2001 From: Adrien RAFFIN Date: Fri, 7 Apr 2017 17:13:11 +0200 Subject: [PATCH] fix: raise exception if uuid not setted in remote org --- pymisp/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pymisp/api.py b/pymisp/api.py index 3f2c723..6699830 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -1258,6 +1258,10 @@ class PyMISP(object): def add_organisation(self, name, **kwargs): new_org = self._set_organisation_parameters(**dict(name=name, **kwargs)) session = self.__prepare_session() + if local in new_org: + if new_org.get('local') == False: + if 'uuid' not in new_org: + raise PyMISPError('A remote org MUST have a valid uuid') url = urljoin(self.root_url, 'admin/organisations/add/') response = session.post(url, data=json.dumps(new_org)) return self._check_response(response)