fix(minor): linting

This commit is contained in:
Rushabh Mehta 2021-09-05 22:30:09 +05:30
parent c2e93256f2
commit 5befc80cd4
8 changed files with 19 additions and 13 deletions

View file

@ -100,10 +100,10 @@ frappe.ui.form.on('DocType', {
'Expression (old style)': 'Format: <code>EXAMPLE-.#####</code> Series by prefix (separated by a dot)',
'Random': '',
'By script': ''
}
};
if (frm.doc.naming_rule) {
frm.get_field('autoname').set_description(naming_rule_description[frm.doc.naming_rule])
frm.get_field('autoname').set_description(naming_rule_description[frm.doc.naming_rule]);
}
},

View file

@ -1032,7 +1032,7 @@ def validate_fields(meta):
def check_max_height(docfield):
if getattr(docfield, 'max_height', None) and (docfield.max_height[-2:] not in ('px', 'em')):
frappe.throw('Max for {1} height must be in px, em, rem'.format(frappe.bold(docfield.fieldname)))
frappe.throw('Max for {} height must be in px, em, rem'.format(frappe.bold(docfield.fieldname)))
fields = meta.get("fields")
fieldname_list = [d.fieldname for d in fields]

View file

@ -1,7 +1,8 @@
# Copyright (c) 2021, Frappe Technologies and contributors
# For license information, please see license.txt
import frappe, os
import frappe
import os
from frappe.model.document import Document
class Package(Document):

View file

@ -1,7 +1,9 @@
# Copyright (c) 2021, Frappe Technologies and Contributors
# See license.txt
import frappe, os, json
import frappe
import os
import json
import unittest
class TestPackage(unittest.TestCase):

View file

@ -1,7 +1,9 @@
# Copyright (c) 2021, Frappe Technologies and contributors
# For license information, please see license.txt
import frappe, os, json
import frappe
import os
import json
import subprocess
from frappe.model.document import Document
from frappe.desk.form.load import get_attachments
@ -17,7 +19,7 @@ class PackageImport(Document):
attachment = get_attachments(self.doctype, self.name)
if not attachment:
frappe.throw('Please attach the package')
frappe.throw(frappe._('Please attach the package'))
attachment = attachment[0]

View file

@ -4,7 +4,8 @@
import frappe
from frappe.model.document import Document
from frappe.modules.export_file import export_doc
import os, subprocess
import os
import subprocess
class PackageRelease(Document):
def set_version(self):
@ -38,7 +39,8 @@ class PackageRelease(Document):
for m in frappe.db.get_all('Module Def', dict(package=self.package)):
module = frappe.get_doc('Module Def', m.name)
for l in module.meta.links:
if l.link_doctype == 'Module Def': continue
if l.link_doctype == 'Module Def':
continue
# all documents of the type in the module
for d in frappe.get_all(l.link_doctype, dict(module=m.name)):
export_doc(frappe.get_doc(l.link_doctype, d.name))

View file

@ -853,7 +853,7 @@ class Database(object):
def _get_aggregation(self, function, dt, fieldname, filters=None):
if not self.has_column(dt, fieldname):
frappe.throw('Invalid column', self.InvalidColumnName)
frappe.throw(frappe._('Invalid column'), self.InvalidColumnName)
return self.get_all(dt, fields = ['%s(%s) as value' % (function, fieldname)], filters=filters)[0].get('value') or 0
@staticmethod

View file

@ -94,9 +94,8 @@ def update_modified(original_modified, doc):
frappe.db.sql("""update tabSingles set value=%s where field="modified" and doctype=%s""",
(original_modified, doc["name"]))
else:
frappe.db.sql("update `tab%s` set modified=%s where name=%s" % \
(doc['doctype'], '%s', '%s'),
(original_modified, doc['name']))
frappe.db.sql("update `tab%s` set modified=%s where name=%s" % (doc['doctype'],
'%s', '%s'), (original_modified, doc['name']))
def import_doc(docdict, force=False, data_import=False, pre_process=None,
ignore_version=None, reset_permissions=False, path=None):