Skip to content

Commit

Permalink
fix: translate only translatable fields (#57)
Browse files Browse the repository at this point in the history
* fix: translate only translatable fields

* refactor: rename variable
  • Loading branch information
e-lobo authored Feb 3, 2022
1 parent e3000b6 commit 8a4b42e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frappe_graphql/utils/resolver/document_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ def _get_value(fieldname, ignore_translation=False):

# ignore_doc_resolver_translation might be helpful for overriding document_resolver
# which might be a simple wrapper around this function (document_resolver)
_df = meta.get_field(info.field_name)
if not ignore_translation and isinstance(
value, str) and not frappe.flags.ignore_doc_resolver_translation:
value, str) and not frappe.flags.ignore_doc_resolver_translation and _df and cint(
_df.get("translatable")):
return frappe._(value)

if __ignore_perms:
Expand Down

0 comments on commit 8a4b42e

Please sign in to comment.