Opened 9 years ago

Closed 9 years ago

#2342 closed defect (fixed)

[patch] DateFieldFilterSpec small fix

Reported by: Alex Dedul Owned by: adrian
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Param 'remove' to cl.get_query_string() must be list, below is a trivial fix.

Index: django/contrib/admin/filterspecs.py
===================================================================
--- django/contrib/admin/filterspecs.py (revision 3337)
+++ django/contrib/admin/filterspecs.py (working copy)
@@ -123,7 +123,7 @@

def choices(self, cl):

for title, param_dict in self.links:

yield {'selected': self.date_params == param_dict,

  • 'query_string': cl.get_query_string(param_dict, self.field_generic),

+ 'query_string': cl.get_query_string(param_dict, [self.field_generic]),

'display': title}

FilterSpec.register(lambda f: isinstance(f, models.DateField), DateFieldFilterSpec)

Change History (3)

comment:1 Changed 9 years ago by Alex Dedul

Ops, here is a formatted version

Index: django/contrib/admin/filterspecs.py
===================================================================
--- django/contrib/admin/filterspecs.py (revision 3337)
+++ django/contrib/admin/filterspecs.py (working copy)
@@ -123,7 +123,7 @@
     def choices(self, cl):
         for title, param_dict in self.links:
             yield {'selected': self.date_params == param_dict,
-                   'query_string': cl.get_query_string(param_dict, self.field_generic),
+                   'query_string': cl.get_query_string(param_dict, [self.field_generic]),
                    'display': title}

 FilterSpec.register(lambda f: isinstance(f, models.DateField), DateFieldFilterSpec)

comment:2 Changed 9 years ago by adrian

I understand the patch, but I'm wondering why it was already working. Oh well! :)

comment:3 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [3403]) Fixed #2342 -- Made small fix to DateFieldFilterSpec. Thanks, Alex Dedul

Note: See TracTickets for help on using tickets.
Back to Top