Skip to content

Commit

Permalink
fix schema.org representation
Browse files Browse the repository at this point in the history
  • Loading branch information
drkane committed Jan 25, 2024
1 parent d276e95 commit a8656fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ftc/models/organisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ def schema_dot_org(self, request=None):
obj["sameAs"] = [request.build_absolute_uri(id) for id in self.sameAs]
else:
obj["sameAs"] = self.sameAs
if len(obj.get("sameAs", [])) == 1:
obj["sameAs"] = obj["sameAs"][0]
return obj

def _get_links(self):
Expand Down
2 changes: 2 additions & 0 deletions ftc/models/related_organisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ def schema_dot_org(self, request=None):
obj["sameAs"] = [request.build_absolute_uri(id) for id in self.sameAs]
else:
obj["sameAs"] = self.sameAs
if len(obj.get("sameAs", [])) == 1:
obj["sameAs"] = obj["sameAs"][0]
return obj

def to_json(self, as_charity=False, request=None, charity=None):
Expand Down

0 comments on commit a8656fe

Please sign in to comment.