Add client IP address to user feedback email

This commit is contained in:
Lance Edgar 2018-11-05 11:24:03 -06:00
parent fec8ba28e2
commit d1980aeed8

View file

@ -134,6 +134,7 @@ class CommonView(View):
data = dict(form.validated) data = dict(form.validated)
if data['user']: if data['user']:
data['user_url'] = self.request.route_url('users.view', uuid=data['user'].uuid) data['user_url'] = self.request.route_url('users.view', uuid=data['user'].uuid)
data['client_ip'] = self.request.client_addr
send_email(self.rattail_config, 'user_feedback', data=data) send_email(self.rattail_config, 'user_feedback', data=data)
return {'ok': True} return {'ok': True}
return {'error': "Form did not validate!"} return {'error': "Form did not validate!"}