summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_api/controllers/controller.py')
-rw-r--r--indoteknik_api/controllers/controller.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/controller.py b/indoteknik_api/controllers/controller.py
index 90bc50ed..0fcf4814 100644
--- a/indoteknik_api/controllers/controller.py
+++ b/indoteknik_api/controllers/controller.py
@@ -108,7 +108,6 @@ class Controller(http.Controller):
return time
def response(self, data=[], code=200, description='OK', headers=[]):
- request.env['user.activity.log'].record_activity()
response = {
'status': {
'code': code,
@@ -169,6 +168,12 @@ class Controller(http.Controller):
def get_api_token(self, **kw):
return self.response(request.env['ir.config_parameter'].sudo().get_param('rest_api_token') or '')
+ @http.route('/api/ip-address', auth='public', methods=['GET', 'OPTIONS'])
+ def get_ip_address(self):
+ address = request.httprequest.remote_addr
+ address = address if address != '127.0.0.1' else False
+ return self.response(address)
+
@http.route('/api/image/<model>/<field>/<id>', auth='public', methods=['GET'])
def get_image(self, model, field, id):
model = request.env[model].sudo().search([('id', '=', id)], limit=1)