Error when trying to delete desktop background image that is set from user configuration

Hi.

I set an image as desktop background. I did it from user configuration. When I try to delete it, I get an error.

This is all the error detail frappe gives:

**App Versions**
"erpnext": "8.8.0",
"frappe": "8.7.0"

**Route**
Form/User/Administrator

**Error Report**
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 56, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 52, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 922, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/utils.py", line 16, in remove_attach
    return frappe.utils.file_manager.remove_file(fid)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 272, in remove_file
    frappe.delete_doc("File", fid, ignore_permissions=ignore_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 656, in delete_doc
    ignore_permissions, flags)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/delete_doc.py", line 88, in delete_doc
    doc.run_method("after_delete")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 666, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 887, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 870, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 660, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 204, in after_delete
    self.update_parent_folder_size()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 115, in update_parent_folder_size
    frappe.get_doc("File", self.folder).set_folder_size()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 98, in set_folder_size
    self.db_set('file_size', self.file_size)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 391, in db_set
    self.modified, self.modified_by, update_modified=update_modified)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 664, in set_value
    values, debug=debug)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 154, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 250, in execute
    self.errorhandler(self, exc, value)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
    raise errorvalue
OperationalError: (1048, "Column 'file_size' cannot be null")


**Request Data**

"type": "POST",
	"args": {
		"fid": "233ffcad1d",
		"dt": "User",
		"dn": "Administrator",
		"cmd": "frappe.desk.form.utils.remove_attach"
},
"url": "/"

Is that an issue?

Thanks in advanced for your help.

Hi, this seems to be working fine in the test account.

Hi @ArundhatiS

I tested it again and it seems the error is only when login as Administrator user. When I login as another user, it works fine.

Thanks