From 0a495cb485ba5bb8bb81dc95fa760b10957b6175 Mon Sep 17 00:00:00 2001 From: Jerome Leclanche Date: Sun, 4 Jun 2017 14:32:59 +0300 Subject: [PATCH] Fix PolymorphicParentModelAdmin.pk_regex escape --- polymorphic/admin/parentadmin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index dd37e40..d156ca2 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -61,7 +61,7 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin): #: The regular expression to filter the primary key in the URL. #: This accepts only numbers as defensive measure against catch-all URLs. #: 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): super(PolymorphicParentModelAdmin, self).__init__(model, admin_site, *args, **kwargs)