Fix PolymorphicParentModelAdmin.pk_regex escape

This commit is contained in:
Jerome Leclanche committed 2017-07-10 09:08:11 +03:00
1 parent b2b20bed55
commit 0a495cb485
1 file changed
+1 -1
+1 -1
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)