mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-13 18:43:08 +00:00
parent
3bd64e9098
commit
3956a45c48
@ -275,8 +275,11 @@ def update_exchange_rates():
|
|||||||
|
|
||||||
def run_backup():
|
def run_backup():
|
||||||
"""Run the backup command."""
|
"""Run the backup command."""
|
||||||
call_command("dbbackup", noinput=True, clean=True, compress=True, interactive=False)
|
from common.models import InvenTreeSetting
|
||||||
call_command("mediabackup", noinput=True, clean=True, compress=True, interactive=False)
|
|
||||||
|
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):
|
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': {
|
'BARCODE_ENABLE': {
|
||||||
'name': _('Barcode Support'),
|
'name': _('Barcode Support'),
|
||||||
'description': _('Enable barcode scanner 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_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_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_TREE_DEPTH" icon="fa-sitemap" %}
|
||||||
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_BACKUP_ENABLE" icon="fa-hdd" %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user