mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Make sure plugins are always on a new line (#4721)
* "Install Plugin" via GUI fails to add plugin to plugins.txt correctly for first plugin Fixes #4719 * remove old change as it was not the root issue * make sure plugins are always written on a new line
This commit is contained in:
parent
c5ba632463
commit
08c4aa4998
@ -154,7 +154,13 @@ class PluginConfigInstallSerializer(serializers.Serializer):
|
||||
|
||||
# save plugin to plugin_file if installed successfull
|
||||
if success:
|
||||
# Read content of plugin file
|
||||
plg_lines = open(settings.PLUGIN_FILE).readlines()
|
||||
with open(settings.PLUGIN_FILE, "a") as plugin_file:
|
||||
# Check if last line has a newline
|
||||
if plg_lines[-1][-1:] != '\n':
|
||||
plugin_file.write('\n')
|
||||
# Write new plugin to file
|
||||
plugin_file.write(f'{" ".join(install_name)} # Installed {timezone.now()} by {str(self.context["request"].user)}\n')
|
||||
|
||||
# Check for migrations
|
||||
|
Loading…
Reference in New Issue
Block a user