Skip to content

Commit ec0eb16

Browse files
committed
Merge branch 'develop'
2 parents 3530d78 + 6bee854 commit ec0eb16

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"base_template": "lib/website/templates/base.html",
3-
"framework_version": "3.9.7",
3+
"framework_version": "3.10.0",
44
"modules": {
55
"Calendar": {
66
"color": "#2980b9",

webnotes/model/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def check_if_doc_is_linked(dt, dn, method="Delete"):
200200
item = webnotes.conn.get_value(link_dt, {link_field:dn},
201201
["name", "parent", "parenttype", "docstatus"], as_dict=True)
202202

203-
if item and item.parent != dn and (method=="Delete" or
203+
if item and item.parent != dn and ((method=="Delete" and item.docstatus<2) or
204204
(method=="Cancel" and item.docstatus==1)):
205205
webnotes.msgprint(method + " " + _("Error") + ":"+\
206206
("%s (%s) " % (dn, dt)) + _("is linked in") + (" %s (%s)") %

wnf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def setup_utilities(parser):
121121
# misc
122122
parser.add_argument("--backup", default=False, action="store_true",
123123
help="Take backup of database in backup folder [--with_files]")
124+
parser.add_argument("--delete_older_than", default=6, type=int, help="delete backup older than")
124125
parser.add_argument("--move", default=False, action="store_true",
125126
help="Move site to different directory defined by --dest_dir")
126127
parser.add_argument("--dest_dir", nargs=1, metavar="DEST-DIR",
@@ -353,10 +354,10 @@ def watch():
353354
webnotes.build.watch(True)
354355

355356
@cmd
356-
def backup(site=None, with_files=False, verbose=True, backup_path_db=None, backup_path_files=None):
357+
def backup(site=None, with_files=False, verbose=True, backup_path_db=None, backup_path_files=None, delete_older_than=6):
357358
from webnotes.utils.backups import scheduled_backup
358359
webnotes.connect(site=site)
359-
odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files)
360+
odb = scheduled_backup(older_than=delete_older_than, ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files)
360361
if verbose:
361362
from webnotes.utils import now
362363
print "database backup taken -", odb.backup_path_db, "- on", now()

0 commit comments

Comments
 (0)