Skip to content

Commit 99c6321

Browse files
committed
Refactor code to include support for importing pictures from cache
1 parent 0ed0a6f commit 99c6321

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/import_pictures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def send_request(session, url, json):
3333
"Authorization": f"Bearer {sesame_api_token}",
3434
}
3535
params = {
36-
"filters[inetOrgPerson.employeeNumber]": f"{json.get('id')}",
36+
"filters[inetOrgPerson.jpegPhoto]": f"{json.get('id')}.jpg",
3737
"filters[inetOrgPerson.employeeType]": "TAIGA",
3838
}
3939

@@ -68,7 +68,7 @@ async def process_data(data, file, session):
6868
print(f"Reading picture {entry['ident']}.jpg")
6969
picture = fichier.read()
7070
files.append({
71-
"id": entry["ident"].split('-')[1],
71+
"id": entry["ident"],
7272
"file": picture,
7373
})
7474

0 commit comments

Comments
 (0)