URL pattern for accounts-view does not allow hyphens

Bug #1151969 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Gavin Panella
1.2
Fix Released
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

Revision history for this message
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)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.