summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-03-21 10:15:34 -0400
committerTim Graham <timograham@gmail.com>2017-03-21 10:15:34 -0400
commit93d07701045c242f81396016ab4ae15ba63a55d9 (patch)
treecd66fde20fdd0069830c89adfc6d5d76be387ea0
parent1e93210f1f622b692dd65e861f0793ac61552d28 (diff)
Refs #27919 -- Changed contrib widget's get_context() attrs kwarg to an arg.
Follow up to 075e93c16a82ba7869a0b2d572e99fdbd0724042.
-rw-r--r--django/contrib/admin/widgets.py8
-rw-r--r--django/contrib/gis/admin/widgets.py2
-rw-r--r--django/contrib/gis/forms/widgets.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py
index fd57436c46..f073c56c8d 100644
--- a/django/contrib/admin/widgets.py
+++ b/django/contrib/admin/widgets.py
@@ -31,7 +31,7 @@ class FilteredSelectMultiple(forms.SelectMultiple):
self.is_stacked = is_stacked
super().__init__(attrs, choices)
- def get_context(self, name, value, attrs=None):
+ def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)
context['widget']['attrs']['class'] = 'selectfilter'
if self.is_stacked:
@@ -129,7 +129,7 @@ class ForeignKeyRawIdWidget(forms.TextInput):
self.db = using
super().__init__(attrs)
- def get_context(self, name, value, attrs=None):
+ def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)
rel_to = self.rel.model
if rel_to in self.admin_site._registry:
@@ -196,7 +196,7 @@ class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
"""
template_name = 'admin/widgets/many_to_many_raw_id.html'
- def get_context(self, name, value, attrs=None):
+ def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)
if self.rel.model in self.admin_site._registry:
# The related object is registered with the same AdminSite
@@ -265,7 +265,7 @@ class RelatedFieldWidgetWrapper(forms.Widget):
return reverse("admin:%s_%s_%s" % (info + (action,)),
current_app=self.admin_site.name, args=args)
- def get_context(self, name, value, attrs=None):
+ def get_context(self, name, value, attrs):
from django.contrib.admin.views.main import IS_POPUP_VAR, TO_FIELD_VAR
rel_opts = self.rel.model._meta
info = (rel_opts.app_label, rel_opts.model_name)
diff --git a/django/contrib/gis/admin/widgets.py b/django/contrib/gis/admin/widgets.py
index d3e817a8c1..1ce94ec7c2 100644
--- a/django/contrib/gis/admin/widgets.py
+++ b/django/contrib/gis/admin/widgets.py
@@ -15,7 +15,7 @@ class OpenLayersWidget(Textarea):
"""
Render an OpenLayers map using the WKT of the geometry.
"""
- def get_context(self, name, value, attrs=None):
+ def get_context(self, name, value, attrs):
# Update the template parameters with any attributes passed in.
if attrs:
self.params.update(attrs)
diff --git a/django/contrib/gis/forms/widgets.py b/django/contrib/gis/forms/widgets.py
index 364d55b7e0..aba16f874a 100644
--- a/django/contrib/gis/forms/widgets.py
+++ b/django/contrib/gis/forms/widgets.py
@@ -40,7 +40,7 @@ class BaseGeometryWidget(Widget):
logger.error("Error creating geometry from value '%s' (%s)", value, err)
return None
- def get_context(self, name, value, attrs=None):
+ def get_context(self, name, value, attrs):
# If a string reaches here (via a validation error on another
# field) then just reconstruct the Geometry.
if value and isinstance(value, str):