Skip to content

Commit e497b12

Browse files
committed
Fixed #81
License texts are not generated in alphabetical order.
1 parent 3436baf commit e497b12

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

about_code_tool/about.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,8 @@ def generate_attribution(self, template_path='templates/default.html',
10941094
# We only need the fields names and values to render the template
10951095
validated_fields = []
10961096
notice_text = []
1097+
license_key = []
1098+
license_text = []
10971099
license_dict = {}
10981100
for about_object in self:
10991101
if not limit_to or about_object.about_resource_path in limit_to:
@@ -1129,9 +1131,14 @@ def generate_attribution(self, template_path='templates/default.html',
11291131
about_object.about_resource_path,\
11301132
msg))
11311133

1134+
# We want the license generation in alphabetical order
1135+
for key in sorted(license_dict.keys()):
1136+
license_key.append(key)
1137+
license_text.append(license_dict[key])
1138+
11321139
return template.render(about_objects=validated_fields,
1133-
license_keys=list(license_dict.keys()),
1134-
license_texts = list(license_dict.values()),
1140+
license_keys=license_key,
1141+
license_texts = license_text,
11351142
notice_texts=notice_text)
11361143

11371144
def get_genattrib_errors(self):

0 commit comments

Comments
 (0)