# HG changeset patch # User cavaliet # Date 1364898460 -7200 # Node ID d294c6f552dca46b71ef964917e16243b2cd680c # Parent e31dd7ea24bb2817de8ce63a9a520e9434d6b678 loadandadddata remove temp files diff -r e31dd7ea24bb -r d294c6f552dc src/ldt/ldt/management/commands/loadandadddata.py --- a/src/ldt/ldt/management/commands/loadandadddata.py Tue Mar 26 14:49:29 2013 +0100 +++ b/src/ldt/ldt/management/commands/loadandadddata.py Tue Apr 02 12:27:40 2013 +0200 @@ -224,6 +224,17 @@ print("Loading permissions from temporary file %s ..." % path_file2) call_command("loaddata", path_file2) + # Remove temp files + print("Removing temporary files...") + try: + os.remove(path_file1) + except: + print("Removing temporary files %s failed" % path_file1) + try: + os.remove(path_file2) + except: + print("Removing temporary files %s failed" % path_file2) + # Now that all datas have been imported we can create the new group and assign permissions if asked new_group = options.get('new_group', None) if new_group and len(usernames)>0: