mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
parent
3bd64e9098
commit
3956a45c48
@ -275,8 +275,11 @@ def update_exchange_rates():
|
||||
|
||||
def run_backup():
|
||||
"""Run the backup command."""
|
||||
call_command("dbbackup", noinput=True, clean=True, compress=True, interactive=False)
|
||||
call_command("mediabackup", noinput=True, clean=True, compress=True, interactive=False)
|
||||
from common.models import InvenTreeSetting
|
||||
|
||||
if InvenTreeSetting.get_setting('INVENTREE_BACKUP_ENABLE'):
|
||||
call_command("dbbackup", noinput=True, clean=True, compress=True, interactive=False)
|
||||
call_command("mediabackup", noinput=True, clean=True, compress=True, interactive=False)
|
||||
|
||||
|
||||
def send_email(subject, body, recipients, from_email=None, html_message=None):
|
||||
|
@ -886,6 +886,13 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
||||
]
|
||||
},
|
||||
|
||||
'INVENTREE_BACKUP_ENABLE': {
|
||||
'name': _('Automatic Backup'),
|
||||
'description': _('Enable automatic backup of database and media files'),
|
||||
'validator': bool,
|
||||
'default': True,
|
||||
},
|
||||
|
||||
'BARCODE_ENABLE': {
|
||||
'name': _('Barcode Support'),
|
||||
'description': _('Enable barcode scanner support'),
|
||||
|
@ -23,6 +23,7 @@
|
||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_DOWNLOAD_IMAGE_MAX_SIZE" icon="fa-server" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_REQUIRE_CONFIRM" icon="fa-check" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_TREE_DEPTH" icon="fa-sitemap" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_BACKUP_ENABLE" icon="fa-hdd" %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user