Skip to content

Commit

Permalink
Merge pull request #741 from praekeltfoundation/fix-change-location
Browse files Browse the repository at this point in the history
Use full path of the image file
  • Loading branch information
erikh360 authored Feb 19, 2024
2 parents 53d3e5c + 1650dc7 commit 5899b1a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vaccine/real411.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from urllib.parse import urljoin

import aiohttp
import pkg_resources
from aiohttp_client_cache import CacheBackend, CachedSession

from vaccine import real411_config as config
Expand Down Expand Up @@ -522,7 +523,10 @@ async def state_submit_report(self):
) as session:
for file, file_url in zip(files, file_urls):
if file["name"] == "placeholder":
with open("vaccine/data/real411_placeholder.png", "rb") as f:
filename = pkg_resources.resource_filename(
"vaccine", "data/real411_placeholder.png"
)
with open(filename, "rb") as f:
file_data = f.read()
else:
file_data = await get_whatsapp_media(file["name"])
Expand Down

0 comments on commit 5899b1a

Please sign in to comment.