Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
(PC-9750) Fix get_offerer query when legacy keys are present
Browse files Browse the repository at this point in the history
  • Loading branch information
viconnex committed Jun 29, 2021
1 parent cc032d3 commit 6b5c0a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pcapi/core/offerers/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,10 @@ def get_filtered_venues(


def get_api_key_prefixes(offerer_id: int) -> list[str]:
return [prefix[0] for prefix in ApiKey.query.filter_by(offererId=offerer_id).with_entities(ApiKey.prefix).all()]
return [
prefix or value[:8]
for prefix, value in ApiKey.query.filter_by(offererId=offerer_id)
.with_entities(ApiKey.prefix, ApiKey.value)
.all()
if prefix or value
]

0 comments on commit 6b5c0a9

Please sign in to comment.