Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[admin] Fixed FileNotFoundError openwisp#140
The change_view associated with BuildAdmin class was throwing an exception when trying to delete a FirmwareImage object, when the file associated with that object had already been deleted from the file system. There were two tasks according to my understanding: 1. Prevent the website to break and catch the error: the return expression in change_view has been put in a try/catch expression, with instructions/hints/warnings for the user using message_user 2. If an image file has been deleted from the filesystem, automatically remove the FirmwareImage assiciated with it: The 'get_queryset' method for FirmwareImageInline class has been over-written to automatically remove FirmwareImage objects associated with deleted files and the information has been logged with logger. Fixes openwisp#140
- Loading branch information