@@ -940,6 +940,17 @@ def dje_license(self):
940940
941941 return "" # Returns empty string if the dje_license key does not exist
942942
943+ def get_license_text_file_name (self ):
944+ """
945+ Return the license_text_file name if the license_text_file field exists
946+ """
947+ try :
948+ return self .parsed ['license_text_file' ]
949+ except Exception as e :
950+ pass
951+
952+ return "" # Returns empty string if the license_text_file key does not exist
953+
943954class AboutCollector (object ):
944955 """
945956 A collection of AboutFile instances.
@@ -1086,10 +1097,16 @@ def generate_attribution(self, template_path='templates/default.html',
10861097 if not limit_to or about_object .about_resource_path in limit_to :
10871098 validated_fields .append (about_object .validated_fields )
10881099 notice_text .append (about_object .notice_text ())
1089- if not about_object .dje_license () in unique_license \
1090- and not about_object .dje_license () == None :
1091- unique_license .append (about_object .dje_license ())
1092- license_text .append (about_object .license_text ())
1100+ if about_object .dje_license ():
1101+ if not about_object .dje_license () in unique_license \
1102+ and not about_object .dje_license () == None :
1103+ unique_license .append (about_object .dje_license ())
1104+ license_text .append (about_object .license_text ())
1105+ elif about_object .get_license_text_file_name ():
1106+ if not about_object .get_license_text_file_name () in unique_license \
1107+ and about_object .license_text ():
1108+ unique_license .append (about_object .get_license_text_file_name ())
1109+ license_text .append (about_object .license_text ())
10931110
10941111 return template .render (about_objects = validated_fields ,
10951112 license_texts = license_text ,
0 commit comments