User: use new escaped hybrid properties for usage in code.

- Allows introducing the safer method of reading first/last names from users.
This commit is contained in:
Marcin Lulek 2017-06-19 10:56:31 +02:00
parent aa3bffd198
commit 91e65dd798

View file

@ -571,6 +571,16 @@ class User(Base, BaseModel):
def email(self, val):
self._email = val.lower() if val else None
@hybrid_property
def first_name(self):
from rhodecode.lib import helpers as h
return h.escape(self.name)
@hybrid_property
def last_name(self):
from rhodecode.lib import helpers as h
return h.escape(self.lastname)
@hybrid_property
def api_key(self):
"""