mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

Link URL field too short for escaped URLs #903

Open wfdd opened 8 years ago

wfdd commented 8 years ago
Internal Server Error: /election/vouleftikes-ekloges-2016/person/create/
Traceback (most recent call last):
  File ".venv/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
psycopg2.DataError: value too long for type character varying(350)

...

{
 'facebook_page_url': 'https://www.facebook.com/%CE%9A%CF%8E%CF%83%CF%84%CE%B1%CF%82-%CE%A7%CF%81%CE%B9%CF%83%CF%84%CE%BF%CE%B4%CE%BF%CF%8D%CE%BB%CE%BF%CF%85-%CE%A5%CF%80%CE%BF%CF%88%CE%AE%CF%86%CE%B9%CE%BF%CF%82-%CE%92%CE%BF%CF%85%CE%BB%CE%B5%CF%85%CF%84%CE%AE%CF%82-%CE%A0%CE%AC%CF%86%CE%BF%CF%85-%CE%A3%CF%85%CE%BC%CE%BC%CE%B1%CF%87%CE%AF%CE%B1-%CE%A0%CE%BF%CE%BB%CE%B9%CF%84%CF%8E%CE%BD-494565017398526/'
}

The 350-character limit is found in django-popolo but I kinda feel like we should be automatically unescaping URLs 'cause this is an unreadable mess.