### Information about bug
The following errors keep showing and repeated ever…y time and I done some research using AI in Google Bard and ChatGPT this following are the answers
**Answers of Google Bard**
`The error is caused by the template _test/_test_safe_render_on. The template contains the following code:
Code snippet
<div>{{ title }}</div>
<div>test.__test</div>
Use code with caution. [Learn more](https://bard.google.com/faq#coding)
The test.__test tag is not a valid Jinja2 tag. This is because the __test keyword is reserved for internal use by Jinja2.
To fix the error, you need to remove the test.__test tag from the template. Once you have removed the tag, the template should render correctly.
Here is the corrected template:
Code snippet
<div>{{ title }}</div>
Use code with caution. [Learn more](https://bard.google.com/faq#coding)
You can also use the safe_render argument to the frappe.render_template() function to prevent Jinja2 from evaluating invalid tags. For example:
Code snippet
html = frappe.render_template(template, context, safe_render=True)
Use code with caution. [Learn more](https://bard.google.com/faq#coding)
This will prevent Jinja2 from evaluating the test.__test tag, and the template will render correctly.`
`The error is caused by the Jinja2 tag raise. This tag is not a valid Jinja2 tag.
To fix the error, you need to remove the raise tag from the template. Once you have removed the tag, the template should render correctly.
Here is the corrected template:
Code snippet
{% extends "base.html" %}
{% block content %}
<h1>This is a test page</h1>
{% endblock %}
Use code with caution. [Learn more](https://bard.google.com/faq#coding)
You can also use the safe_render argument to the frappe.render_template() function to prevent Jinja2 from evaluating invalid tags. For example:
Code snippet
html = frappe.render_template(template, context, safe_render=True)
Use code with caution. [Learn more](https://bard.google.com/faq#coding)
This will prevent Jinja2 from evaluating the raise tag, and the template will render correctly.`
`The error is caused by the None value passed to the get_meta() method. The get_meta() method expects a valid DocType name, but None is not a valid DocType name.
To fix the error, you need to pass a valid DocType name to the get_meta() method. For example, you could pass the name of a DocType that already exists in your ERPNext instance.
Here is an example of how to fix the error:
Python
from frappe import get_meta
doctype = "Customer"
meta = get_meta(doctype)
Use code with caution. [Learn more](https://bard.google.com/faq#coding)
This code will get the meta data for the Customer DocType. If the Customer DocType does not exist in your ERPNext instance, then you will get an error.`
`The error is caused by the printpreview method in the frappe.website.page_renderers.template_page module. This method tries to get the HTML content of a Print Format document, but the print_format parameter is not set.
To fix the error, you need to set the print_format parameter to the ID of the Print Format document that you want to preview. For example, if the ID of the Print Format document is 1234, you would set the print_format parameter to 1234.
Here is an example of how to fix the error:
Python
from frappe.website.page_renderers.template_page import TemplatePage
def printpreview(doctype, print_format=None):
if print_format is None:
raise Exception("Print Format not set")
template_page = TemplatePage(doctype)
html = template_page.get_html(doctype, print_format)
return html
Use code with caution. [Learn more](https://bard.google.com/faq#coding)
This code will first check if the print_format parameter is set. If it is not set, the code will raise an exception. If the print_format parameter is set, the code will get the HTML content of the Print Format document and return it.`
**Answers of ChatGPT**
`It appears that you're getting an Illegal template error when trying to render a Jinja template. The issue appears to originate from the code that handles rendering of templates.
From the traceback, the error is happening at the following point:
python
Copy code
html = frappe.render_template(self.source, self.context, safe_render=safe_render)
And the corresponding error is Illegal template, which seems to be caused by the fact that the system isn't allowing the execution of the provided template because it believes the template is unsafe or illegal. This could be due to several reasons:
There's an unsafe operation in the template. When the safe_render parameter is set to True in frappe.render_template(), the template is expected to not include any operations which are considered unsafe, such as executing shell commands, accessing sensitive parts of the system, etc.
The template syntax is incorrect. Make sure your Jinja syntax is valid and follows the documentation.
In the traceback, the following line indicates your template content:
python
Copy code
template = '<div>{{ title }}</div>\n<div>test.__test</div>\n'
This line indicates that the title variable is being rendered within a div tag, which is perfectly valid in a Jinja template. However, the second line (test.__test) is suspect and might be causing the issue. In Python, name mangling applies to any identifier that starts with double underscore (__). In general, you should avoid using names that begin with double underscore in a Jinja template.
To fix the error, I suggest changing the test.__test in your Jinja template to a valid identifier. If test is a dictionary and you want to access a value with a key __test, you could use the following syntax instead: test['__test'].
Please review your template, make the necessary adjustments and try again.`
`This error is related to Jinja2, the template engine that ERPNext uses. The error message is saying that Jinja encountered an unknown tag 'raise'.
Jinja2 does not have a 'raise' tag, so it appears there is some code in your template that Jinja doesn't understand. The line of your code that's causing the issue appears to be: {% raise %}.
The traceback indicates that the error originates from a file named 'problematic_page'. The error appears while trying to compile the template in the from_string method in Jinja2's environment.py file.
There are two primary things you should check:
Check the file mentioned in the traceback '_test/problematic_page' and see if you have the string {% raise %} somewhere. If so, you will need to replace this with something else or remove it, depending on what you're trying to achieve with this code.
If you do not find any '{% raise %}' in your templates, then you need to inspect your templates for any custom template tags. If you have any custom template tags, they may be causing the problem if they're not correctly defined.
For example, if you have a custom template tag named 'raise' and it's not defined correctly, it could cause this error. You would need to either fix the definition of the custom template tag or remove it.
Remember to clear any cache or temporary files after making changes, as they may still reference the old code and continue to cause the error.`
`The error message "DocType None not found" suggests that you're trying to access a DocType (a form model or a business object type in ERPNext) which is not found or doesn't exist. Specifically, in the call to frappe.get_meta(doctype), the variable doctype is None. It's likely that a DocType name should have been provided, but it wasn't, or the provided value was not found in the system.
Based on the traceback, it seems the error is arising from the 'list' view of a certain DocType. The list view in ERPNext is typically accessed through the URL in the format: [your-site-url]/desk#List/[DocType] and it seems the DocType part is missing or not correctly specified in your case.
The resolution to this issue depends on the circumstances:
If you are trying to access a DocType list from the ERPNext interface (e.g., by clicking on a link), it could be a bug in ERPNext or a custom app, or it could be due to a database inconsistency. If you believe it's a bug in ERPNext, you can report it to the ERPNext community.
If you have custom code that is producing this error, you need to review your code. Check the part of your code where you're trying to get the list view of a DocType. Ensure that the DocType name is correctly specified.
If the error is appearing after a system update or modification, try clearing the cache and reloading. If that doesn't work, check for database consistency issues. This is a more complex process and should ideally be handled by an ERPNext expert or system administrator.
Remember, if you're not sure, it's always a good idea to get help from someone who has experience with ERPNext.`
`The error you're seeing is primarily coming from this part: DoesNotExistError('Print Format None not found'). This error typically means that the software is trying to access a "Print Format" object which does not exist or could not be found. In the context of the Frappe Framework, a Print Format is a customizable template used to display and print documents.
The error traceback shows that the system is trying to fetch a print format via this line:
python
Copy code
frappe.get_doc('Print Format', frappe.form_dict.print_format).get_html(frappe.form_dict.name, frappe.form_dict.letterhead)
It seems that frappe.form_dict.print_format is returning None which suggests that the Print Format is not specified or it doesn't exist in the database.
This error is raised by the Frappe framework, which is used to build web applications. The application is trying to fetch a Print Format document with the name None, but it cannot find such a document in the database.
A Print Format is a template used to display data in the application, usually for printing or generating PDF reports. When the name is None, it indicates that some part of your code is attempting to retrieve a Print Format without providing a specific name, hence causing this error.
Here are a few possible solutions:
If you're trying to fetch a Print Format in your code, make sure the name of the Print Format is correctly specified.
If this error occurs during a certain operation in the user interface, it could be a bug in the application. Make sure you're using the latest version of your application or ERPNext, and consider reporting this issue to the maintainers.
If you're developing a custom application on top of Frappe or ERPNext, ensure that your code correctly handles situations where a Print Format may not exist. Consider using a default Print Format or properly notifying the user when the specified Print Format is not found.
This error occurs in the Frappe framework, used to build web applications, and it involves two main parts.
First, an issue arises when trying to get the context for a Jinja template (Jinja is a templating language for Python). Specifically, the problem occurs when it tries to use the get_doc function to retrieve a Print Format, which is a template used to display data, usually for printing or PDF reports.
The second part of the error is the frappe.exceptions.DoesNotExistError which happens because the application is trying to fetch a Print Format with the name None in the database, but it can't find such a document. This is a result of the previous function call get_doc('Print Format', None) which failed to return a valid Print Format document.
In essence, the error is happening because some part of your code or application workflow is trying to retrieve a Print Format without providing a specific name, causing the DoesNotExistError.
To resolve this, you should ensure that the correct name for the Print Format is provided when calling the get_doc function. This could be a bug in your application or it might be a result of custom code that needs to be adjusted to handle the case where the name of the Print Format is not specified or doesn't exist.
`
### Module
other
### Version
ERPNext: v14.29.2 (version-14)
Frappe Framework: v14.40.2 (version-14)
### Installation method
manual install
### Relevant log output / Stack trace / Full Error Message.
```shell
`Title
_test/_test_safe_render_on failed
Error
Traceback with variables (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 18, in get_response
response = renderer_instance.render()
path = '_test/_test_safe_render_on'
http_status_code = 200
response = None
endpoint = '_test/_test_safe_render_on'
path_resolver = <frappe.website.path_resolver.PathResolver object at 0x7fe05952ffa0>
renderer_instance = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058d57d90>
e = ValidationError('Illegal template')
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058d57d90>
File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
html = func(*args, **kwargs)
args = (<frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058d57d90>,)
kwargs = {}
func = <function TemplatePage.get_html at 0x7fe05bbc7490>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 101, in get_html
html = self.render_template()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058d57d90>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 238, in render_template
html = frappe.render_template(self.source, self.context, safe_render=safe_render)
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058d57d90>
safe_render = True
File "apps/frappe/frappe/utils/jinja.py", line 83, in render_template
throw(_("Illegal template"))
template = '<div>{{ title }}</div>\n<div>test.__test</div>\n'
context = {'top_bar_items': [], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': 'Thimar Libnan Super Market', 'copyright': 'Abdelhmaid & Co Certified Public Accountants & Auditors', 'disable_signup': 1, 'hide_footer_signup': 1, 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'url': 'http://localhost', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: Standard>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Dubai', 'user': 'Asia/Dubai'}}, 'base_template': None, 'basepath': 'apps/frappe/frappe/www/_test', 'base...
is_path = None
safe_render = True
TemplateError = <class 'jinja2.exceptions.TemplateError'>
_ = <function _ at 0x7fe061fe4e50>
get_traceback = <function get_traceback at 0x7fe06125b7f0>
throw = <function throw at 0x7fe06125bc70>
File "apps/frappe/frappe/__init__.py", line 528, in throw
msgprint(
msg = 'Illegal template'
exc = <class 'frappe.exceptions.ValidationError'>
title = None
is_minimizable = False
wide = False
as_list = False
File "apps/frappe/frappe/__init__.py", line 496, in msgprint
_raise_exception()
title = None
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
sys = <module 'sys' (built-in)>
out = {'message': 'Illegal template', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1}
_raise_exception = <function msgprint.<locals>._raise_exception at 0x7fe0596600d0>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7fe059671a60>
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Illegal template'
raise_exception = <class 'frappe.exceptions.ValidationError'>
strip_html_tags = <function strip_html_tags at 0x7fe061242c20>
File "apps/frappe/frappe/__init__.py", line 445, in _raise_exception
raise raise_exception(msg)
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Illegal template'
raise_exception = <class 'frappe.exceptions.ValidationError'>
frappe.exceptions.ValidationError: Illegal template`
`Title
printpreview failed
Error
Traceback with variables (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 18, in get_response
response = renderer_instance.render()
path = 'printpreview'
http_status_code = 200
response = None
endpoint = 'printpreview'
path_resolver = <frappe.website.path_resolver.PathResolver object at 0x7fe059603790>
renderer_instance = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe0596fd630>
e = DoesNotExistError('Print Format None not found')
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe0596fd630>
File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
html = func(*args, **kwargs)
args = (<frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe0596fd630>,)
kwargs = {}
func = <function TemplatePage.get_html at 0x7fe05bbc7490>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 101, in get_html
html = self.render_template()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe0596fd630>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 238, in render_template
html = frappe.render_template(self.source, self.context, safe_render=safe_render)
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe0596fd630>
safe_render = True
File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template
return get_jenv().from_string(template).render(context)
template = "\n{{\n frappe\n .get_doc('Print Format', frappe.form_dict.print_format)\n .get_html(frappe.form_dict.name, frappe.form_dict.letterhead)\n}}\n"
context = {'top_bar_items': [], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': 'Thimar Libnan Super Market', 'copyright': 'Abdelhmaid & Co Certified Public Accountants & Auditors', 'disable_signup': 1, 'hide_footer_signup': 1, 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'url': 'http://localhost', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: Standard>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Dubai', 'user': 'Asia/Dubai'}}, 'base_template': None, 'basepath': 'apps/frappe/frappe/www', 'basename':...
is_path = None
safe_render = True
TemplateError = <class 'jinja2.exceptions.TemplateError'>
_ = <function _ at 0x7fe061fe4e50>
get_traceback = <function get_traceback at 0x7fe06125b7f0>
throw = <function throw at 0x7fe06125bc70>
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
self = <Template memory:7fe0595ea6e0>
args = ({'top_bar_items': [], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': 'Thimar Libnan Super Market', 'copyright': 'Abdelhmaid & Co Certified Public Accountants & Auditors', 'disable_signup': 1, 'hide_footer_signup': 1, 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'url': 'http://localhost', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: Standard>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Dubai', 'user': 'Asia/Dubai'}}, 'base_template': None, 'basepath': 'apps/frappe/frappe/www', 'basename'...
kwargs = {}
ctx = <Context {'range': <class 'range'>, 'dict': <class 'dict'>, 'lipsum': <function generate_lorem_ipsum at 0x7fe05a2e2830>, 'cycler': <class 'jinja2.utils.Cycler'>, 'joiner': <class 'jinja2.utils.Joiner'>, 'namespace': <class 'jinja2.utils.Namespace'>, 'json': {'loads': <function loads at 0x7fe061ec4430>, 'dumps': <function dumps at 0x7fe061eb7e20>}, 'as_json': <function as_json at 0x7fe0610565f0>, 'log': <function log at 0x7fe06125b9a0>, '_dict': <class 'frappe._dict'>, 'args': {}, 'frappe': {'call': <function call_whitelisted_function at 0x7fe059749000>, 'flags': {}, 'format': <function format_value at 0x7fe0610567a0>, 'format_value': <function format_value at 0x7fe0610567a0>, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss', 'format_date': <function global_date_format at 0x7fe06123a950>, 'form_dict': {}, 'bold': <function bold at 0x7fe061056f80>, 'copy_doc': <function copy_doc at 0x7fe0610560e0>, 'errprint': <function errprint at 0x7fe06125b880>, 'qb': <class 'frappe.query_builde...
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
self = <jinja2.sandbox.SandboxedEnvironment object at 0x7fe05a3cc820>
source = None
rewrite_traceback_stack = <function rewrite_traceback_stack at 0x7fe0595ca710>
File "<template>", line 5, in top-level template code
range = <class 'range'>
dict = <class 'dict'>
lipsum = <function generate_lorem_ipsum at 0x7fe05a2e2830>
cycler = <class 'jinja2.utils.Cycler'>
joiner = <class 'jinja2.utils.Joiner'>
namespace = <class 'jinja2.utils.Namespace'>
json = {'loads': <function loads at 0x7fe061ec4430>, 'dumps': <function dumps at 0x7fe061eb7e20>}
as_json = <function as_json at 0x7fe0610565f0>
log = <function log at 0x7fe06125b9a0>
_dict = <class 'frappe._dict'>
args = {}
frappe = {'call': <function call_whitelisted_function at 0x7fe059749000>, 'flags': {}, 'format': <function format_value at 0x7fe0610567a0>, 'format_value': <function format_value at 0x7fe0610567a0>, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss', 'format_date': <function global_date_format at 0x7fe06123a950>, 'form_dict': {}, 'bold': <function bold at 0x7fe061056f80>, 'copy_doc': <function copy_doc at 0x7fe0610560e0>, 'errprint': <function errprint at 0x7fe06125b880>, 'qb': <class 'frappe.query_builder.builder.MariaDB'>, 'get_meta': <function get_meta at 0x7fe061054ee0>, 'new_doc': <function new_doc at 0x7fe0610548b0>, 'get_doc': <function get_doc at 0x7fe061054d30>, 'get_mapped_doc': <function get_mapped_doc at 0x7fe05a015510>, 'get_last_doc': <function get_last_doc at 0x7fe061054dc0>, 'get_cached_doc': <function get_cached_doc at 0x7fe0610549d0>, 'get_list': <function get_list at 0x7fe061056440>, 'get_all': <function get_all at 0x7fe0610564d0>, 'get_system_settings': <function get_sys...
FrappeClient = <class 'frappe.frappeclient.FrappeClient'>
style = {'border_color': '#d1d8dd'}
get_toc = <function get_toc at 0x7fe05bb808b0>
get_next_link = <function get_next_link at 0x7fe05bb80940>
_ = <function _ at 0x7fe061fe4e50>
get_shade = <function get_shade at 0x7fe05bb80790>
scrub = <function scrub at 0x7fe060c6d900>
guess_mimetype = <function guess_type at 0x7fe061adda20>
html2text = <function html2text at 0x7fe059e00310>
dev_server = 0
run_script = <function run_script at 0x7fe059749090>
is_job_queued = <function is_job_queued at 0x7fe059748ee0>
get_visible_columns = <function get_visible_columns at 0x7fe059748c10>
__builtins__ = {'__build_class__': <built-in function __build_class__>, 'None': None, 'False': False, 'True': True, 'abs': <built-in function abs>, 'bool': <class 'bool'>, 'bytes': <class 'bytes'>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'complex': <class 'complex'>, 'divmod': <built-in function divmod>, 'float': <class 'float'>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'int': <class 'int'>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'len': <built-in function len>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'range': <class 'range'>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'slice': <class 'slice'>, 'sorted': <built-in function sorted>, 'str': <class 'str'>, 'tuple': <class 'tuple'>, 'zip': <class 'zip'>, 'ArithmeticError': <class 'ArithmeticError'>, 'AssertionError': <class 'Assertion...
_write_ = <function _write at 0x7fe059749750>
_getitem_ = <function _getitem at 0x7fe059749630>
_getattr_ = <function _getattr at 0x7fe0597496c0>
_getiter_ = <built-in function iter>
_iter_unpack_sequence_ = <function guarded_iter_unpack_sequence at 0x7fe059fe9630>
abs = <built-in function abs>
all = <built-in function all>
any = <built-in function any>
bool = <class 'bool'>
enumerate = <class 'enumerate'>
isinstance = <built-in function isinstance>
issubclass = <built-in function issubclass>
list = <class 'list'>
max = <built-in function max>
min = <built-in function min>
set = <class 'set'>
sorted = <built-in function sorted>
sum = <built-in function sum>
tuple = <class 'tuple'>
bundled_asset = <function bundled_asset at 0x7fe059748160>
get_dom_id = <function get_dom_id at 0x7fe05972ff40>
include_script = <function include_script at 0x7fe059748040>
include_style = <function include_style at 0x7fe0597480d0>
inspect = <function inspect at 0x7fe05972fd90>
is_rtl = <function is_rtl at 0x7fe0597481f0>
resolve_class = <function resolve_class at 0x7fe05972fc70>
web_block = <function web_block at 0x7fe05972fe20>
web_blocks = <function web_blocks at 0x7fe05972feb0>
top_bar_items = []
footer_items = []
post_login = [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}]
brand_html = 'Thimar Libnan Super Market'
copyright = 'Abdelhmaid & Co Certified Public Accountants & Auditors'
disable_signup = 1
hide_footer_signup = 1
facebook_share = 0
google_plus_one = 0
twitter_share = 0
linked_in_share = 0
url = 'http://localhost'
encoded_title = ''
web_include_js = ['website_script.js', 'erpnext-web.bundle.js']
web_include_css = ['erpnext-web.bundle.css']
favicon = '/assets/erpnext/images/erpnext-favicon.svg'
splash_image = '/assets/erpnext/images/erpnext-logo.svg'
theme = <WebsiteTheme: Standard>
hide_login = 0
read_only_mode = False
boot = {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Dubai', 'user': 'Asia/Dubai'}}
base_template = None
basepath = 'apps/frappe/frappe/www'
basename = 'apps/frappe/frappe/www/printpreview'
name = 'printpreview'
path = 'printpreview'
route = 'printpreview'
template = 'www/printpreview.html'
build_version = 'bu9FcdyT'
developer_mode = None
no_cache = 1
title = 'Printpreview'
fullname = 'Guest'
user_image = None
user = 'Guest'
sidebar_items = [{'name': 'cf64060bfb', 'owner': 'Administrator', 'creation': datetime.datetime(2021, 7, 10, 23, 28, 36, 434402), 'modified': datetime.datetime(2021, 7, 10, 23, 31, 32, 688865), 'modified_by': 'Administrator', 'docstatus': 0, 'idx': 2, 'title': 'Projects', 'enabled': 1, 'route': '/project', 'reference_doctype': 'Project', 'role': None, 'target': None, 'parent': 'Portal Settings', 'parentfield': 'menu', 'parenttype': 'Portal Settings', 'doctype': 'Portal Menu Item'}, {'name': '83ba1436a2', 'owner': 'Administrator', 'creation': datetime.datetime(2021, 7, 10, 23, 28, 36, 434402), 'modified': datetime.datetime(2021, 7, 10, 23, 31, 32, 688865), 'modified_by': 'Administrator', 'docstatus': 0, 'idx': 12, 'title': 'Addresses', 'enabled': 1, 'route': '/addresses', 'reference_doctype': 'Address', 'role': None, 'target': None, 'parent': 'Portal Settings', 'parentfield': 'menu', 'parenttype': 'Portal Settings', 'doctype': 'Portal Menu Item'}, {'name': '2d8a2ce353', 'owner': 'Administrator', 'creat...
metatags = {'title': 'Printpreview', 'language': 'en', 'og:type': 'article', 'og:title': 'Printpreview', 'twitter:title': 'Printpreview', 'twitter:card': 'summary'}
base_template_path = 'templates/base.html'
shopping_cart_enabled = 1
_context_dict = {'top_bar_items': [], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': 'Thimar Libnan Super Market', 'copyright': 'Abdelhmaid & Co Certified Public Accountants & Auditors', 'disable_signup': 1, 'hide_footer_signup': 1, 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'url': 'http://localhost', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: Standard>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Dubai', 'user': 'Asia/Dubai'}}, 'base_template': None, 'basepath': 'apps/frappe/frappe/www', 'basename':...
indicator_color = 'red'
primary_action = '/login?redirect-to=/me'
primary_label = 'Login'
fullpage = True
canonical = 'http://localhost/printpreview'
url_prefix = ''
pathname = 'printpreview'
docs_base_url = '/docs'
File "env/lib/python3.10/site-packages/jinja2/sandbox.py", line 393, in call
return __context.call(__obj, *args, **kwargs)
_SandboxedEnvironment__self = <jinja2.sandbox.SandboxedEnvironment object at 0x7fe05a3cc820>
_SandboxedEnvironment__context = <Context {'range': <class 'range'>, 'dict': <class 'dict'>, 'lipsum': <function generate_lorem_ipsum at 0x7fe05a2e2830>, 'cycler': <class 'jinja2.utils.Cycler'>, 'joiner': <class 'jinja2.utils.Joiner'>, 'namespace': <class 'jinja2.utils.Namespace'>, 'json': {'loads': <function loads at 0x7fe061ec4430>, 'dumps': <function dumps at 0x7fe061eb7e20>}, 'as_json': <function as_json at 0x7fe0610565f0>, 'log': <function log at 0x7fe06125b9a0>, '_dict': <class 'frappe._dict'>, 'args': {}, 'frappe': {'call': <function call_whitelisted_function at 0x7fe059749000>, 'flags': {}, 'format': <function format_value at 0x7fe0610567a0>, 'format_value': <function format_value at 0x7fe0610567a0>, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss', 'format_date': <function global_date_format at 0x7fe06123a950>, 'form_dict': {}, 'bold': <function bold at 0x7fe061056f80>, 'copy_doc': <function copy_doc at 0x7fe0610560e0>, 'errprint': <function errprint at 0x7fe06125b880>, 'qb': <class 'frappe.query_builde...
_SandboxedEnvironment__obj = <function get_doc at 0x7fe061054d30>
args = ('Print Format', None)
kwargs = {}
fmt = None
File "apps/frappe/frappe/__init__.py", line 1187, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
args = ('Print Format', None)
kwargs = {}
frappe = <module 'frappe' from 'apps/frappe/frappe/__init__.py'>
File "apps/frappe/frappe/model/document.py", line 74, in get_doc
return controller(*args, **kwargs)
args = ('Print Format', None)
kwargs = {}
doctype = 'Print Format'
controller = <class 'frappe.printing.doctype.print_format.print_format.PrintFormat'>
File "apps/frappe/frappe/model/document.py", line 106, in __init__
self.load_from_db()
self = <PrintFormat: unsaved>
args = ('Print Format', None)
kwargs = {}
__class__ = <class 'frappe.model.document.Document'>
File "apps/frappe/frappe/model/document.py", line 149, in load_from_db
frappe.throw(
self = <PrintFormat: unsaved>
d = None
__class__ = <class 'frappe.model.document.Document'>
File "apps/frappe/frappe/__init__.py", line 528, in throw
msgprint(
msg = 'Print Format None not found'
exc = <class 'frappe.exceptions.DoesNotExistError'>
title = None
is_minimizable = False
wide = False
as_list = False
File "apps/frappe/frappe/__init__.py", line 496, in msgprint
_raise_exception()
title = None
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
sys = <module 'sys' (built-in)>
out = {'message': 'Print Format None not found', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1}
_raise_exception = <function msgprint.<locals>._raise_exception at 0x7fe05a355f30>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7fe05a3e3c10>
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Print Format None not found'
raise_exception = <class 'frappe.exceptions.DoesNotExistError'>
strip_html_tags = <function strip_html_tags at 0x7fe061242c20>
File "apps/frappe/frappe/__init__.py", line 445, in _raise_exception
raise raise_exception(msg)
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Print Format None not found'
raise_exception = <class 'frappe.exceptions.DoesNotExistError'>
frappe.exceptions.DoesNotExistError: Print Format None not found`
`Title
_test/problematic_page failed
Error
Traceback with variables (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 18, in get_response
response = renderer_instance.render()
path = '_test/problematic_page'
http_status_code = 200
response = None
endpoint = '_test/problematic_page'
path_resolver = <frappe.website.path_resolver.PathResolver object at 0x7fe058b71ea0>
renderer_instance = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe05954fe20>
e = ValidationError('<pre>{% raise %}\n</pre><pre>Traceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "<unknown>", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n</pre>')
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe05954fe20>
File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
html = func(*args, **kwargs)
args = (<frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe05954fe20>,)
kwargs = {}
func = <function TemplatePage.get_html at 0x7fe05bbc7490>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 101, in get_html
html = self.render_template()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe05954fe20>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 238, in render_template
html = frappe.render_template(self.source, self.context, safe_render=safe_render)
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe05954fe20>
safe_render = True
File "apps/frappe/frappe/utils/jinja.py", line 87, in render_template
throw(
template = '{% raise %}\n'
context = {'top_bar_items': [], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': 'Thimar Libnan Super Market', 'copyright': 'Abdelhmaid & Co Certified Public Accountants & Auditors', 'disable_signup': 1, 'hide_footer_signup': 1, 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'url': 'http://localhost', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: Standard>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Dubai', 'user': 'Asia/Dubai'}}, 'base_template': None, 'basepath': 'apps/frappe/frappe/www/_test', 'base...
is_path = None
safe_render = True
TemplateError = <class 'jinja2.exceptions.TemplateError'>
_ = <function _ at 0x7fe061fe4e50>
get_traceback = <function get_traceback at 0x7fe06125b7f0>
throw = <function throw at 0x7fe06125bc70>
File "apps/frappe/frappe/__init__.py", line 528, in throw
msgprint(
msg = '<pre>{% raise %}\n</pre><pre>Traceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "<unknown>", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n</pre>'
exc = <class 'frappe.exceptions.ValidationError'>
title = 'Jinja Template Error'
is_minimizable = False
wide = False
as_list = False
File "apps/frappe/frappe/__init__.py", line 496, in msgprint
_raise_exception()
title = 'Jinja Template Error'
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
sys = <module 'sys' (built-in)>
out = {'message': '<pre>{% raise %}\n</pre><pre>Traceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "<unknown>", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n</pre>', 'title': 'Jinja Template Error', 'indicator': 'red', 'raise_exception': 1}
_raise_exception = <function msgprint.<locals>._raise_exception at 0x7fe0595c9a20>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7fe0593c1590>
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = '<pre>{% raise %}\n</pre><pre>Traceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "<unknown>", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n</pre>'
raise_exception = <class 'frappe.exceptions.ValidationError'>
strip_html_tags = <function strip_html_tags at 0x7fe061242c20>
File "apps/frappe/frappe/__init__.py", line 445, in _raise_exception
raise raise_exception(msg)
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = '<pre>{% raise %}\n</pre><pre>Traceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "<unknown>", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n</pre>'
raise_exception = <class 'frappe.exceptions.ValidationError'>
frappe.exceptions.ValidationError: <pre>{% raise %}
</pre><pre>Traceback (most recent call last):
File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template
return get_jenv().from_string(template).render(context)
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string
return cls.from_code(self, self.compile(source), gs, None)
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile
self.handle_exception(source=source_hint)
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<unknown>", line 1, in template
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'raise'.
</pre>`
`Title
list failed
Error
Traceback with variables (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 18, in get_response
response = renderer_instance.render()
path = 'list'
http_status_code = 200
response = None
endpoint = 'list'
path_resolver = <frappe.website.path_resolver.PathResolver object at 0x7fe058c80c40>
renderer_instance = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058c8cfd0>
e = DoesNotExistError('DocType None not found')
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058c8cfd0>
File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
html = func(*args, **kwargs)
args = (<frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058c8cfd0>,)
kwargs = {}
func = <function TemplatePage.get_html at 0x7fe05bbc7490>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
self.update_context()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058c8cfd0>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
data = self.run_pymodule_method("get_context")
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058c8cfd0>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 225, in run_pymodule_method
return method(self.context)
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fe058c8cfd0>
method_name = 'get_context'
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
method = <function get_context at 0x7fe05974b9a0>
File "apps/frappe/frappe/www/list.py", line 21, in get_context
context.meta = frappe.get_meta(doctype)
context = {'top_bar_items': [], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': 'Thimar Libnan Super Market', 'copyright': 'Abdelhmaid & Co Certified Public Accountants & Auditors', 'disable_signup': 1, 'hide_footer_signup': 1, 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'url': 'http://localhost', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: Standard>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Dubai', 'user': 'Asia/Dubai'}}, 'base_template': None, 'basepath': 'apps/frappe/frappe/www', 'basename':...
dict_params = {}
doctype = None
File "apps/frappe/frappe/__init__.py", line 1214, in get_meta
return frappe.model.meta.get_meta(doctype, cached=cached)
doctype = None
cached = True
frappe = <module 'frappe' from 'apps/frappe/frappe/__init__.py'>
File "apps/frappe/frappe/model/meta.py", line 65, in get_meta
meta = Meta(doctype)
doctype = None
cached = True
meta = None
File "apps/frappe/frappe/model/meta.py", line 117, in __init__
super().__init__("DocType", doctype)
self = <Meta: unsaved>
doctype = None
__class__ = <class 'frappe.model.meta.Meta'>
File "apps/frappe/frappe/model/document.py", line 106, in __init__
self.load_from_db()
self = <Meta: unsaved>
args = ('DocType', None)
kwargs = {}
__class__ = <class 'frappe.model.document.Document'>
File "apps/frappe/frappe/model/meta.py", line 123, in load_from_db
super().load_from_db()
self = <Meta: unsaved>
__class__ = <class 'frappe.model.meta.Meta'>
File "apps/frappe/frappe/model/document.py", line 149, in load_from_db
frappe.throw(
self = <Meta: unsaved>
d = None
__class__ = <class 'frappe.model.document.Document'>
File "apps/frappe/frappe/__init__.py", line 528, in throw
msgprint(
msg = 'DocType None not found'
exc = <class 'frappe.exceptions.DoesNotExistError'>
title = None
is_minimizable = False
wide = False
as_list = False
File "apps/frappe/frappe/__init__.py", line 496, in msgprint
_raise_exception()
title = None
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
sys = <module 'sys' (built-in)>
out = {'message': 'DocType None not found', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1}
_raise_exception = <function msgprint.<locals>._raise_exception at 0x7fe058e69240>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7fe058d9d380>
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'DocType None not found'
raise_exception = <class 'frappe.exceptions.DoesNotExistError'>
strip_html_tags = <function strip_html_tags at 0x7fe061242c20>
File "apps/frappe/frappe/__init__.py", line 445, in _raise_exception
raise raise_exception(msg)
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'DocType None not found'
raise_exception = <class 'frappe.exceptions.DoesNotExistError'>
frappe.exceptions.DoesNotExistError: DocType None not found`
```