Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdvyas committed Mar 13, 2014
2 parents 3530d78 + 6bee854 commit ec0eb16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"base_template": "lib/website/templates/base.html",
"framework_version": "3.9.7",
"framework_version": "3.10.0",
"modules": {
"Calendar": {
"color": "#2980b9",
Expand Down
2 changes: 1 addition & 1 deletion webnotes/model/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def check_if_doc_is_linked(dt, dn, method="Delete"):
item = webnotes.conn.get_value(link_dt, {link_field:dn},
["name", "parent", "parenttype", "docstatus"], as_dict=True)

if item and item.parent != dn and (method=="Delete" or
if item and item.parent != dn and ((method=="Delete" and item.docstatus<2) or
(method=="Cancel" and item.docstatus==1)):
webnotes.msgprint(method + " " + _("Error") + ":"+\
("%s (%s) " % (dn, dt)) + _("is linked in") + (" %s (%s)") %
Expand Down
5 changes: 3 additions & 2 deletions wnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def setup_utilities(parser):
# misc
parser.add_argument("--backup", default=False, action="store_true",
help="Take backup of database in backup folder [--with_files]")
parser.add_argument("--delete_older_than", default=6, type=int, help="delete backup older than")
parser.add_argument("--move", default=False, action="store_true",
help="Move site to different directory defined by --dest_dir")
parser.add_argument("--dest_dir", nargs=1, metavar="DEST-DIR",
Expand Down Expand Up @@ -353,10 +354,10 @@ def watch():
webnotes.build.watch(True)

@cmd
def backup(site=None, with_files=False, verbose=True, backup_path_db=None, backup_path_files=None):
def backup(site=None, with_files=False, verbose=True, backup_path_db=None, backup_path_files=None, delete_older_than=6):
from webnotes.utils.backups import scheduled_backup
webnotes.connect(site=site)
odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files)
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)
if verbose:
from webnotes.utils import now
print "database backup taken -", odb.backup_path_db, "- on", now()
Expand Down

0 comments on commit ec0eb16

Please sign in to comment.