From 6cb43bb32c35b4370c128989533bc6a763ec2f66 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 21 Mar 2023 16:15:35 +0200 Subject: [PATCH] reduce max length of agendaposter_phrase to 50 --- files/routes/awards.py | 4 ++-- migrations/20230319-make-agendaposter-phrase-customizable.sql | 2 +- schema.sql | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index d51f88c3a..8020046d7 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -311,8 +311,8 @@ def award_thing(v, thing_type, id): agendaposter_phrase = agendaposter_phrase.strip() if not agendaposter_phrase: abort(400, "Missing phrase!") - if len(agendaposter_phrase) > 100: - abort(400, "Max length for phrase is 100 characters") + if len(agendaposter_phrase) > 50: + abort(400, "Max length for phrase is 50 characters") author.agendaposter_phrase = agendaposter_phrase diff --git a/migrations/20230319-make-agendaposter-phrase-customizable.sql b/migrations/20230319-make-agendaposter-phrase-customizable.sql index 068421ecc..ba9f7f389 100644 --- a/migrations/20230319-make-agendaposter-phrase-customizable.sql +++ b/migrations/20230319-make-agendaposter-phrase-customizable.sql @@ -1,2 +1,2 @@ -alter table users add column agendaposter_phrase varchar(100); +alter table users add column agendaposter_phrase varchar(50); update users set agendaposter_phrase='trans lives matter' where agendaposter>0; diff --git a/schema.sql b/schema.sql index bb7ae8ccc..a948caf37 100644 --- a/schema.sql +++ b/schema.sql @@ -1056,7 +1056,7 @@ CREATE TABLE public.users ( event_darkmode boolean, blacklisted_by integer, hidevotedon boolean DEFAULT false NOT NULL, - agendaposter_phrase character varying(100) + agendaposter_phrase character varying(50) ); @@ -2896,4 +2896,3 @@ ALTER TABLE ONLY public.comments -- -- PostgreSQL database dump complete -- -