Fix PolymorphicParentModelAdmin.pk_regex escape

fix_request_path_info
Jerome Leclanche 2017-06-04 14:32:59 +03:00
parent b2b20bed55
commit 0a495cb485
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin):
#: The regular expression to filter the primary key in the URL. #: The regular expression to filter the primary key in the URL.
#: This accepts only numbers as defensive measure against catch-all URLs. #: This accepts only numbers as defensive measure against catch-all URLs.
#: If your primary key consists of string values, update this regular expression. #: If your primary key consists of string values, update this regular expression.
pk_regex = '(\d+|__fk__)' pk_regex = r"(\d+|__fk__)"
def __init__(self, model, admin_site, *args, **kwargs): def __init__(self, model, admin_site, *args, **kwargs):
super(PolymorphicParentModelAdmin, self).__init__(model, admin_site, *args, **kwargs) super(PolymorphicParentModelAdmin, self).__init__(model, admin_site, *args, **kwargs)