]> git.lizzy.rs Git - cheatdb.git/commitdiff
Fix crash by truncating notification titles
authorrubenwardy <rw@rubenwardy.com>
Sat, 31 Aug 2019 17:38:15 +0000 (18:38 +0100)
committerrubenwardy <rw@rubenwardy.com>
Sat, 31 Aug 2019 17:38:15 +0000 (18:38 +0100)
app/models.py

index 4b835bbe9ec01007de13304ff2b039a05670039c..a2601541d13330a9b9bf0916ae085f73a9c658ea 100644 (file)
@@ -213,6 +213,9 @@ class Notification(db.Model):
        url       = db.Column(db.String(200), nullable=True)
 
        def __init__(self, us, cau, titl, ur):
+               if len(titl) > 100:
+                       title = title[:99] + "…"
+
                self.user   = us
                self.causer = cau
                self.title  = titl