google-code-export / django-hotclub

Automatically exported from code.google.com/p/django-hotclub
MIT License
0 stars 0 forks source link

Add support for spaces in usernames #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Imported usernames from an existing database with spaces in them
2. Attempted to login with a name with spaces
3. Immediatly get template errors

What is the expected output? 
The users profile page

What do you see instead?
Eror message:
Caught an exception while rendering: Reverse for
'PlazaWeb.profiles.views.profile' with arguments '(<User: Hearts Master>,)'
and keyword arguments '{}' not found.

Original Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\django\template\debug.py", line 71,
in render_node
    result = node.render(context)
  File "C:\Python25\Lib\site-packages\django\template\defaulttags.py", line
378, in render
    args=args, kwargs=kwargs)
  File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", line
252, in reverse
    *args, **kwargs)))
  File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", line
241, in reverse
    "arguments '%s' not found." % (lookup_view, args, kwargs))
NoReverseMatch: Reverse for 'PlazaWeb.profiles.views.profile' with
arguments '(<User: Hearts Master>,)' and keyword arguments '{}' not found.

What version of the product are you using? On what operating system?
Head revision in svn on Windows XP, Python 2.5

Please provide any additional information below.
We're importing existing users from a system that supported spaces. We have
to solve this problem to move forward using Pinax.

Original issue reported on code.google.com by gromp...@gmail.com on 14 Oct 2008 at 9:39

GoogleCodeExporter commented 9 years ago
I've had good luck by updating urls regex to allow spaces, for example:
url(r'^(?P<username>[\w ]+)/$', 'profiles.views.profile', 
name='profile_detail'),

Original comment by gromp...@gmail.com on 14 Oct 2008 at 11:30

GoogleCodeExporter commented 9 years ago
As there's a workaround I'm going to close this as there are no plans to make 
this
the default

Original comment by jtau...@gmail.com on 27 Oct 2008 at 10:44