Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: status.py

Issue 108823002: chromium-status: improve status field editing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-status
Patch Set: replace newlines with spaces Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « static/js/main/main.js ('k') | templates/main.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: status.py
diff --git a/status.py b/status.py
index 02efdacb7d6082c777cf2572defdbc0eee08c8a0..8925c8e330e0295288b41c7d0c713eb17307cfad 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', ' ')
+ super(Status, self).__init__(*args, **kwargs)
+
@property
def username_links(self):
return LinkableText(self.username)
« no previous file with comments | « static/js/main/main.js ('k') | templates/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698