I am facing this issue when user is trying to attach file with extension of xmprj. I checked handler.py code
if content is not None and (
frappe.session.user == "Guest" or (user and not user.has_desk_access())
):
filetype = guess_type(filename)[0]
if filetype not in ALLOWED_MIMETYPES:
frappe.throw(_("You can only upload JPG, PNG, PDF, TXT or Microsoft documents."))
Looking at check should only be there for users who doesn’t have desk access , I cross checked the role of user it has desk access. I have created custom role which has desk access but still this user is not able to attach the file of other extensions. I have another custom role which is able to attach file of any extension, this role also has desk access. I am clueless on this why will this validation exception will be thrown if the role has desk access.
Thank you for your inputs I do understand that guest user is allowed to attach specific extension but here what I am referring to is not a guest user but a system user who has role which has desk access.It works for one custom role but doesn’t work for other so makes me wonder what’s the real logic implemented is.