diff options
author | francis <francis> | 2009-09-07 17:31:36 +0000 |
---|---|---|
committer | francis <francis> | 2009-09-07 17:31:36 +0000 |
commit | a5869799758e4e79094778cd7df21a013d5fb3ba (patch) | |
tree | 4338316f601a170c349f3d7e044db90e1f7778ca /app/models/user.rb | |
parent | cd3baa5e71a1ef17d3e43b839e8e68b08533799e (diff) |
Don't allow numeric only URL names.
Test the URL name code a bit.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index f18a4e7ab..abf418ff4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -23,7 +23,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user.rb,v 1.100 2009-08-27 15:44:23 francis Exp $ +# $Id: user.rb,v 1.101 2009-09-07 17:31:38 francis Exp $ require 'digest/sha1' @@ -153,7 +153,7 @@ class User < ActiveRecord::Base self.update_url_name end def update_url_name - url_name = MySociety::Format.simplify_url_part(self.name, 32) + url_name = MySociety::Format.simplify_url_part(self.name, 'user', 32) # For user with same name as others, add on arbitary numeric identifier unique_url_name = url_name suffix_num = 2 # as there's already one without numeric suffix |