aboutsummaryrefslogtreecommitdiff
path: root/app/models.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-08-31 18:38:15 +0100
committerrubenwardy <rw@rubenwardy.com>2019-08-31 18:38:15 +0100
commit655ed2255a10d8e05fcf48f9dfb803013968a397 (patch)
treec79e76e2ad724a82728ff4bd5a67e2bf5ad977f4 /app/models.py
parent96b22744ec29d3d75a78cde965efb56a26720eb3 (diff)
downloadcheatdb-655ed2255a10d8e05fcf48f9dfb803013968a397.tar.xz
Fix crash by truncating notification titles
Diffstat (limited to 'app/models.py')
-rw-r--r--app/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models.py b/app/models.py
index 4b835bb..a260154 100644
--- a/app/models.py
+++ b/app/models.py
@@ -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