Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
blocks/description: give direct pagejaunes url
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-dupre committed Jul 20, 2021
1 parent c48ab62 commit 9f3db25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion idunn/blocks/description.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ def from_es(cls, place, lang):
else:
source = DescriptionSources.OSM

return cls(description=description, source=source)
return cls(description=description, source=source, url=place.get_description_url(lang))

return None
3 changes: 3 additions & 0 deletions idunn/places/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ def get_quotation_request_url(self):
def get_description(self, lang):
return self.properties.get(f"description:{lang}")

def get_description_url(self, _lang):
return None

def get_bbox(self):
return None

Expand Down
6 changes: 6 additions & 0 deletions idunn/places/pj_poi.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,9 @@ def get_description(self, lang):
return None

return self.data.description

def get_description_url(self, lang):
if lang != "fr":
return None

return self.get_source_url()

0 comments on commit 9f3db25

Please sign in to comment.