Chromium Code Reviews| Index: status.py |
| diff --git a/status.py b/status.py |
| index 5962e78c06689f8d34c51fb933d1955c3615bfff..e00b30a7e0f43b1976a2429b6672f7c69885e2ec 100644 |
| --- a/status.py |
| +++ b/status.py |
| @@ -137,6 +137,13 @@ class Status(db.Model): |
| # The message. It can contain html code. |
| message = db.StringProperty(required=True) |
| + def __init__(self, *args, **kwargs): |
| + # Normalize newlines otherwise the DB store barfs. We don't really want to |
| + # make this field handle newlines as none of the places where we output the |
| + # content is designed to handle it, nor the clients that consume us. |
| + kwargs['message'] = kwargs.get('message', '').replace('\n', '') |
|
agable
2014/03/25 17:17:19
newlines should be replaced with whitespace, not e
vapier
2014/03/25 18:01:13
Done.
|
| + super(Status, self).__init__(*args, **kwargs) |
| + |
| @property |
| def username_links(self): |
| return LinkableText(self.username) |