Ticket #490: management.patch
File management.patch, 1.9 KB (added by , 19 years ago) |
---|
-
management.py
218 218 219 219 # Check that the package exists in the database. 220 220 cursor.execute("SELECT 1 FROM packages WHERE label = %s", [app_label]) 221 if cursor.rowcount < 1: 221 if cursor.rowcount < 0: 222 # can be -1 (==undetermined) according to http://www.python.org/peps/pep-0249.html 223 flag = cursor.fetchone() is None 224 else: 225 flag = cursor.rowcount < 1 226 if flag: 222 227 # sys.stderr.write("The '%s' package isn't installed.\n" % app_label) 223 228 print _get_packages_insert(app_label) 224 229 … … 232 237 contenttypes_seen[opts.module_name] = 1 233 238 for codename, name in perms: 234 239 cursor.execute("SELECT 1 FROM auth_permissions WHERE package = %s AND codename = %s", (app_label, codename)) 235 if cursor.rowcount < 1: 240 if cursor.rowcount < 0: 241 # can be -1 (==undetermined) according to http://www.python.org/peps/pep-0249.html 242 flag = cursor.fetchone() is None 243 else: 244 flag = cursor.rowcount < 1 245 if flag: 236 246 # sys.stderr.write("The '%s.%s' permission doesn't exist.\n" % (app_label, codename)) 237 247 print _get_permission_insert(name, codename, opts) 238 248 cursor.execute("SELECT 1 FROM content_types WHERE package = %s AND python_module_name = %s", (app_label, opts.module_name)) 239 if cursor.rowcount < 1: 249 if cursor.rowcount < 0: 250 # can be -1 (==undetermined) according to http://www.python.org/peps/pep-0249.html 251 flag = cursor.fetchone() is None 252 else: 253 flag = cursor.rowcount < 1 254 if flag: 240 255 # sys.stderr.write("The '%s.%s' content type doesn't exist.\n" % (app_label, opts.module_name)) 241 256 print _get_contenttype_insert(opts) 242 257