I'm currently trying to modify the lookup editor app,
But i'm having trouble on limiting previous version, i did it through CSS and HTML.
But the files are still located at the folder. How can i limit the revert version to 5 and delete the older versions.
You can also do something like this in order to delete "old" backups in the folder after some time. It's a quick fix that is working with the 3.6.0 version. You have to place piece of code at the end of the function "backup_lookup_file" (before the return dst) in the "lookup_backups.py" file 🙂
# Remove backup files that are "old" list_of_files = os.listdir(backup_directory) current_time = time.time() for i in list_of_files: file_location = backup_directory + "/" + i file_time = os.stat(file_location).st_mtime if(file_time < current_time - 86400 * 5): os.remove(file_location) self.logger.info('Removing lookup file="%s" from backup folder="%s" because max time excedeed', i, backup_directory)