🐛 Fixed an error when deleting a file if file output to the file system is disabled and the user does not have write permission to the file system. #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DatabaseStorage.delete
の呼び出し時に、ファイルシステム上にキャッシュがある場合に削除を行う処理があり、その処理で呼び出されるget_hash_fn
関数内で、ファイルシステム上にキャッシュファイルの保存先ディレクトリが存在しなければ作成するという処理があり、その部分でread-onlyであったり書き込み権限がない場合にエラーとなっていた。https://github.com/CreditEngine/django-binary-database-files/blob/96a7457bb8678c66758afa05c61b1f178cba0399/binary_database_files/utils.py#L36C5-L48
該当関数でディレクトリを作成しないようにする対応方法もあったが、そもそもファイルシステム上にキャッシュを行う設定がoffの場合には、そのキャッシュの削除処理を行わないようにすることで対処。
https://creditengine.slack.com/archives/C0127M395NV/p1691633013314179