Commit e3626628 authored by Łukasz Nowak's avatar Łukasz Nowak

Fix naming.

parent 81fb0aa2
...@@ -187,7 +187,7 @@ def responseSupport(anonymous=False): ...@@ -187,7 +187,7 @@ def responseSupport(anonymous=False):
str(user_name)) str(user_name))
if len(user_document) != 1: if len(user_document) != 1:
transaction.abort() transaction.abort()
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Currenty logged in user %r wrong document list %r.'% 'Currenty logged in user %r wrong document list %r.'%
(user_name, user_document)) (user_name, user_document))
self.REQUEST.response.setStatus(500) self.REQUEST.response.setStatus(500)
...@@ -217,13 +217,13 @@ def extractDocument(portal_type): ...@@ -217,13 +217,13 @@ def extractDocument(portal_type):
portal_type))) portal_type)))
self.document_url = document.getRelativeUrl() self.document_url = document.getRelativeUrl()
except WrongRequest: except WrongRequest:
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Problem while trying to find document:', error=True) 'Problem while trying to find document:', error=True)
self.REQUEST.response.setStatus(404) self.REQUEST.response.setStatus(404)
except (Unauthorized, KeyError): except (Unauthorized, KeyError):
self.REQUEST.response.setStatus(404) self.REQUEST.response.setStatus(404)
except Exception: except Exception:
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Problem while trying to find instance:', error=True) 'Problem while trying to find instance:', error=True)
self.REQUEST.response.setStatus(500) self.REQUEST.response.setStatus(500)
self.REQUEST.response.setBody(jsonify({'error': self.REQUEST.response.setBody(jsonify({'error':
...@@ -279,7 +279,7 @@ class InstancePublisher(GenericPublisher): ...@@ -279,7 +279,7 @@ class InstancePublisher(GenericPublisher):
self.REQUEST.response.setStatus(200) self.REQUEST.response.setStatus(200)
except Exception: except Exception:
transaction.abort() transaction.abort()
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Problem while modifying:', error=True) 'Problem while modifying:', error=True)
self.REQUEST.response.setStatus(500) self.REQUEST.response.setStatus(500)
self.REQUEST.response.setBody(jsonify({'error': self.REQUEST.response.setBody(jsonify({'error':
...@@ -297,7 +297,7 @@ class InstancePublisher(GenericPublisher): ...@@ -297,7 +297,7 @@ class InstancePublisher(GenericPublisher):
self.restrictedTraverse(self.document_url self.restrictedTraverse(self.document_url
).bang(bang_tree=True, comment=self.jbody['log']) ).bang(bang_tree=True, comment=self.jbody['log'])
except Exception: except Exception:
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Problem while trying to generate instance dict:', error=True) 'Problem while trying to generate instance dict:', error=True)
self.REQUEST.response.setStatus(500) self.REQUEST.response.setStatus(500)
self.REQUEST.response.setBody(jsonify({'error': self.REQUEST.response.setBody(jsonify({'error':
...@@ -339,7 +339,7 @@ class InstancePublisher(GenericPublisher): ...@@ -339,7 +339,7 @@ class InstancePublisher(GenericPublisher):
).requestSoftwareInstance(**request_dict) ).requestSoftwareInstance(**request_dict)
except Exception: except Exception:
transaction.abort() transaction.abort()
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Problem with person.requestSoftwareInstance:', error=True) 'Problem with person.requestSoftwareInstance:', error=True)
self.REQUEST.response.setStatus(500) self.REQUEST.response.setStatus(500)
self.REQUEST.response.setBody(jsonify({'error': self.REQUEST.response.setBody(jsonify({'error':
...@@ -383,7 +383,7 @@ class InstancePublisher(GenericPublisher): ...@@ -383,7 +383,7 @@ class InstancePublisher(GenericPublisher):
} }
} }
except Exception: except Exception:
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Problem while trying to generate instance dict:', error=True) 'Problem while trying to generate instance dict:', error=True)
self.REQUEST.response.setStatus(500) self.REQUEST.response.setStatus(500)
self.REQUEST.response.setBody(jsonify({'error': self.REQUEST.response.setBody(jsonify({'error':
...@@ -490,7 +490,7 @@ class ComputerPublisher(GenericPublisher): ...@@ -490,7 +490,7 @@ class ComputerPublisher(GenericPublisher):
computer.Computer_updateFromJson(self.jbody) computer.Computer_updateFromJson(self.jbody)
except Exception: except Exception:
transaction.abort() transaction.abort()
LOG('VifibRestApiV1Tool', ERROR, LOG('VifibRestApiV1', ERROR,
'Problem while trying to update computer:', error=True) 'Problem while trying to update computer:', error=True)
self.REQUEST.response.setStatus(500) self.REQUEST.response.setStatus(500)
self.REQUEST.response.setBody(jsonify({'error': self.REQUEST.response.setBody(jsonify({'error':
......
12 13
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment