diff --git a/web/main/models.py b/web/main/models.py index 669711db5..831315833 100644 --- a/web/main/models.py +++ b/web/main/models.py @@ -1655,33 +1655,40 @@ def export_content(self, request): elif self.resource_type == "TextBlock": return rich_text_export(self.resource.content, request=request, id_prefix=str(self.id)) return self.resource.content - + def get_ali_license_text(self) -> str: licensed_materials = [ { "title": "Restatements of the Law", "copyright_year": 2014, - "match_words": ["restatement", "restatements", "contracts", "restatements of the law"] + "match_words": [ + "restatement", + "restatements", + "contracts", + "restatements of the law", + ], }, { "title": "Principles of the Law", "copyright_year": 2015, - "match_words": ["principle", "principles", "principles of the law"] + "match_words": ["principle", "principles", "principles of the law"], }, { "title": "Model Penal Code", "copyright_year": 2016, - "match_words": ["model penal code", "mpc"] - } + "match_words": ["model penal code", "mpc"], + }, ] - license_txt = '' + license_txt = "" title = self.title.lower() for item in licensed_materials: if any(word.lower() in title.split() for word in item["match_words"]): - license_txt = (f"{item['title']}, copyright @ {item['copyright_year']} by the American Law Institute. " - f"Reproduced with permission, not as part of a Creative Commons license.") + license_txt = ( + f"{item['title']}, copyright @ {item['copyright_year']} by the American Law Institute. " + f"Reproduced with permission, not as part of a Creative Commons license." + ) return license_txt @property