From 6b9f130278f98b3a15f7ad1959269c200e084f03 Mon Sep 17 00:00:00 2001 From: Ian Clelland Date: Thu, 27 Sep 2012 21:30:13 -0700 Subject: [PATCH] Sort HTML attributes on generated forms --- django/forms/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/forms/util.py b/django/forms/util.py index 9b1bcebe337..724f256e40b 100644 --- a/django/forms/util.py +++ b/django/forms/util.py @@ -20,7 +20,7 @@ def flatatt(attrs): The result is passed through 'mark_safe'. """ - return format_html_join('', ' {0}="{1}"', attrs.items()) + return format_html_join('', ' {0}="{1}"', sorted(attrs.items())) @python_2_unicode_compatible class ErrorDict(dict):