Skip to content

Commit 8a98060

Browse files
Fixed #7 -- Fixed subtle admin changelist filter bug in maintaining state. Thanks for the patch, Manuzhai!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@417 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 9d8dd86 commit 8a98060

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django/views/admin/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def change_list(request, app_label, module_name):
230230
elif isinstance(f, meta.DateField):
231231
today = datetime.date.today()
232232
one_week_ago = today - datetime.timedelta(days=7)
233-
field_generic = '%s__' % field_name
233+
field_generic = '%s__' % f.name
234234
filter_template.append('<h3>By %s:</h3><ul>\n' % f.verbose_name)
235235
date_params = dict([(k, v) for k, v in params.items() if k.startswith(field_generic)])
236236
today_str = isinstance(f, meta.DateTimeField) and today.strftime('%Y-%m-%d 23:59:59') or today.strftime('%Y-%m-%d')

0 commit comments

Comments
 (0)