URL pattern for accounts-view does not allow hyphens

Bug #1151969 reported by Gavin Panella on 2013-03-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Gavin Panella
1.2
High
Gavin Panella

Bug Description

The accounts-view URL pattern is defined as:

    adminurl(
        r'^accounts/(?P<username>\w+)/view/$', AccountsView.as_view(),
        name='accounts-view'),

The username is defined as:

    username = forms.RegexField(label=_("Username"), max_length=30,
        regex=r'^[\w.@+-]+$',

(See django.contrib.auth.forms.UserCreationForm.)

However, the URL pattern should probably allow [^/]+ instead of trying
to mirror the form field.

It would also be worth checking other URL patterns.

Related branches

Raphaël Badin (rvb) wrote :

> However, the URL pattern should probably allow [^/]+ instead of trying
> to mirror the form field.

I concur, there is no point in trying to be too clever in the url patterns.

Raphaël Badin (rvb) on 2013-03-07
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers