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:
parent
aa3bffd198
commit
91e65dd798
1 changed files with 10 additions and 0 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue