# HG changeset patch # User Pawel Solyga # Date 1233221630 0 # Node ID 6acbbb68f032b82c79f470e0a079c6666d3a6ca1 # Parent 75f72ea26883af041fb99c23e57eea35337aca40 Fix regexp for link id format validation. Link id needs to start with ASCII lowercase and not with digit, which caused User Profile view to crash. Patch by: Pawel Solyga Reviewed by: to-be-reviewed diff -r 75f72ea26883 -r 6acbbb68f032 app/soc/models/linkable.py --- a/app/soc/models/linkable.py Thu Jan 29 08:14:46 2009 +0000 +++ b/app/soc/models/linkable.py Thu Jan 29 09:33:50 2009 +0000 @@ -30,7 +30,7 @@ from soc.models import base -# start with ASCII digit or lowercase +# start with ASCII lowercase # (additional ASCII digit or lowercase # -OR- # underscore and ASCII digit or lowercase) @@ -39,7 +39,7 @@ # * starting or ending underscores are *not* permitted # * double internal underscores are *not* permitted # -LINK_ID_PATTERN_CORE = r'[0-9a-z](?:[0-9a-z]|_[0-9a-z])*' +LINK_ID_PATTERN_CORE = r'[a-z](?:[0-9a-z]|_[0-9a-z])*' LINK_ID_ARG_PATTERN = r'(?P%s)' % LINK_ID_PATTERN_CORE LINK_ID_PATTERN = r'^%s$' % LINK_ID_PATTERN_CORE LINK_ID_REGEX = re.compile(LINK_ID_PATTERN)