bensteUEM / ChurchToolsAPI

Collection of Python files to use the API for ChurchTools
6 stars 4 forks source link

Error on using file_delete #37

Open bensteUEM opened 1 year ago

bensteUEM commented 1 year ago

Traceback (most recent call last): File "/home/benste/PycharmProjects/SongBeamerQS/main.py", line 489, in <module> upload_local_songs_by_id(df_sng, df_ct) File "/home/benste/PycharmProjects/SongBeamerQS/main.py", line 453, in upload_local_songs_by_id api.file_upload("/".join([row['path'], row['filename']]), domain_type='song_arrangement', File "/home/benste/PycharmProjects/ChurchToolsAPI/ChurchToolsApi.py", line 299, in file_upload self.file_delete(domain_type, domain_identifier, delete_file_name) File "/home/benste/PycharmProjects/ChurchToolsAPI/ChurchToolsApi.py", line 350, in file_delete files = json.loads(response.content)['data'] KeyError: 'data'

Logging shows 2023-02-12 20:44:05,661 root DEBUG deleting old file before download 2023-02-12 20:44:05,730 urllib3.connectionpool DEBUG https://elkw1610.krz.tools:443 "GET /api/files/song_arrangement/998 HTTP/1.1" 200 None 2023-02-12 20:44:05,826 urllib3.connectionpool DEBUG https://elkw1610.krz.tools:443 "DELETE /api/files/6989 HTTP/1.1" 204 0 2023-02-12 20:44:05,868 urllib3.connectionpool DEBUG https://elkw1610.krz.tools:443 "POST /api/files/song_arrangement/998 HTTP/1.1" 429 None 2023-02-12 20:44:05,869 root WARNING {"message":"Too many requests","translatedMessage":"","messageKey":"","args":[],"errors":[]} 2023-02-12 20:44:05,870 root DEBUG deleting old file before download 2023-02-12 20:44:05,909 urllib3.connectionpool DEBUG https://elkw1610.krz.tools:443 "GET /api/files/song_arrangement/1001 HTTP/1.1" 429 None

bensteUEM commented 1 year ago

failed with "too many requests" after uploading 200 out of 640 songs...