summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Clelland <ian@fullfactor.com>2012-09-27 21:30:13 -0700
committerLuke Plant <L.Plant.98@cantab.net>2012-12-24 02:20:19 +0000
commit5f07d24eaaa4879d90db6d7b4085cd6238042bd0 (patch)
tree5bb5dd750b414cd5bd9eaf573dd72e0cb15f3430
parentcade3405c05097c13d316e8423f70474f4bed8c3 (diff)
[1.5.x] Sort HTML attributes on generated forms
Backport of 6b9f130278f98b3a15f7ad1959269c200e084f03 from master
-rw-r--r--django/forms/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/util.py b/django/forms/util.py
index 9b1bcebe33..724f256e40 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):