internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: frappe/frappe

Issue:
Password Strength Policy Enhancement
Password Strength Policy Enhancement
In Security Settings, the Password Policy can be enabled(See image 1 below) and the password strength score can be set.
User will see helpful password validation messages when they set/change password.

Set Password Policy:
![system_settings](https://cloud.githubusercontent.com/assets/9530991/25556724/5ca4339a-2d34-11e7-8e5d-7af3a59c3b6c.png)

Prompt friendly message to user, based on the password policy:
![user password ploicy validation](https://cloud.githubusercontent.com/assets/9530991/25556721/5c80db48-2d34-11e7-8b29-3550a82bf546.png)

Reset Password Strength Validation fail based on Password Policy:
![reset_password_fail_policy_test](https://cloud.githubusercontent.com/assets/9530991/25556722/5c86472c-2d34-11e7-8ee7-684df8f482f0.png)

Reset Password Strength Validation pass based on Password Policy:
![reset_password_pass_policy_test](https://cloud.githubusercontent.com/assets/9530991/25556723/5c9e449e-2d34-11e7-9ad5-6dab209633ad.png)






Discussion:
Can you also add a few test cases?

Resolving patch:
diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py
--- a/frappe/core/doctype/user/user.py
+++ b/frappe/core/doctype/user/user.py
@@ -545,9 +545,9 @@ def test_password_strength(new_password, key=None, old_password=None, user_data=
 		enable_password_policy = cint(frappe.db.get_single_value("System Settings", "enable_password_policy")) and True or False
 		minimum_password_score = cint(frappe.db.get_single_value("System Settings", "minimum_password_score")) or 0
 
-		password_policy_validation_passed = True
-		if enable_password_policy and result['score'] < minimum_password_score:
-			password_policy_validation_passed = False
+		password_policy_validation_passed = False
+		if result['score'] > minimum_password_score:
+			password_policy_validation_passed = True
 
 		result['feedback']['password_policy_validation_passed'] = password_policy_validation_passed
 


Test patch:
Repository: frappe/frappe

Issue:
Sort in export
<!--

Some key notes before you open a PR:

 1. Select which branch should this PR be merged in?
 2. PR name follows [convention](http://karma-runner.github.io/4.0/dev/git-commit-msg.html)
 3. All tests pass locally, UI and Unit tests
 4. All business logic and validations must be on the server-side
 5. Update necessary Documentation
 6. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes


Also, if you're new here

- Documentation Guidelines => https://github.com/frappe/erpnext/wiki/Updating-Documentation

- Contribution Guide => https://github.com/frappe/frappe/blob/develop/.github/CONTRIBUTING.md

- Pull Request Checklist => https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist

-->

> Please provide enough information so that others can review your pull request:

<!-- You can skip this if you're fixing a typo or updating existing documentation -->

> Explain the **details** for making this change. What existing problem does the pull request solve?

<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->

> Screenshots/GIFs

<!-- Add images/recordings to better visualize the change: expected/current behviour -->



Discussion:

Resolving patch:
diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py
--- a/frappe/desk/query_report.py
+++ b/frappe/desk/query_report.py
@@ -146,18 +146,17 @@ def export_query():
 			
 		# build table from dict
 		if isinstance(data.result[0], dict):
-			for row in data.result:
-				if row:
+			for i,row in enumerate(data.result):
+				# only rows which are visible in the report
+				if row and (i+1 in visible_idx):
 					row_list = []
 					for idx in range(len(data.columns)):
 						row_list.append(row.get(columns[idx]["fieldname"],""))
 					result.append(row_list)
+				elif not row:
+					result.append([])
 		else:
 			result = result + data.result
-		
-		# filter rows by slickgrid's inline filter
-		if visible_idx:
-			result = [x for idx, x in enumerate(result) if idx == 0 or idx in visible_idx]
 
 		from frappe.utils.xlsxutils import make_xlsx
 		xlsx_file = make_xlsx(result, "Query Report")


Test patch:
Repository: frappe/frappe

Issue:
Issue changing 'Unique' field option in v8 (erpnext#9948)
#### Expected Behaviour
In customize doctype form, deselecting `unique` should also remove unique constraint from database table.
#### Actual Behaviour
Deselecting `unique` does not remove unique constraint from database table.
#### Steps to reproduce:
As specified in frappe/erpnext#9948

Frappe version: 
frappe 8.5.7


Discussion:

Resolving patch:
diff --git a/frappe/model/db_schema.py b/frappe/model/db_schema.py
--- a/frappe/model/db_schema.py
+++ b/frappe/model/db_schema.py
@@ -314,7 +314,7 @@ def alter(self):
 				# if index key exists
 				if frappe.db.sql("""show index from `{0}`
 					where key_name=%s
-					and Non_unique=%s""".format(self.name), (col.fieldname, 0 if col.unique else 1)):
+					and Non_unique=%s""".format(self.name), (col.fieldname, col.unique)):
 					query.append("drop index `{}`".format(col.fieldname))
 
 		for col in self.set_default:


Test patch:
diff --git a/frappe/core/doctype/doctype/test_doctype.py b/frappe/core/doctype/doctype/test_doctype.py
--- a/frappe/core/doctype/doctype/test_doctype.py
+++ b/frappe/core/doctype/doctype/test_doctype.py
@@ -8,13 +8,14 @@
 
 # test_records = frappe.get_test_records('DocType')
 
+
 class TestDocType(unittest.TestCase):
-	def new_doctype(self, name):
+	def new_doctype(self, name, unique=0):
 		return frappe.get_doc({
 			"doctype": "DocType",
 			"module": "Core",
 			"custom": 1,
-			"fields": [{"label": "Some Field", "fieldname": "some_fieldname", "fieldtype": "Data"}],
+			"fields": [{"label": "Some Field", "fieldname": "some_fieldname", "fieldtype": "Data", "unique": unique}],
 			"permissions": [{"role": "System Manager", "read": 1}],
 			"name": name
 		})
@@ -28,4 +29,28 @@ def test_validate_name(self):
 				frappe.delete_doc("DocType", name)
 
 			doc = self.new_doctype(name).insert()
-			doc.delete()
\ No newline at end of file
+			doc.delete()
+
+	def test_doctype_unique_constraint_dropped(self):
+		if frappe.db.exists("DocType", "With_Unique"):
+			frappe.delete_doc("DocType", "With_Unique")
+
+		dt = self.new_doctype("With_Unique", unique=1)
+		dt.insert()
+
+		doc1 = frappe.new_doc("With_Unique")
+		doc2 = frappe.new_doc("With_Unique")
+		doc1.some_fieldname = "Something"
+		doc1.name = "one"
+		doc2.some_fieldname = "Something"
+		doc2.name = "two"
+
+		doc1.insert()
+		self.assertRaises(frappe.UniqueValidationError, doc2.insert)
+
+		dt.fields[0].unique = 0
+		dt.save()
+
+		doc2.insert()
+		doc1.delete()
+		doc2.delete()
Repository: frappe/frappe

Issue:
Emails sending doesn't work for accented sender names after #4050
Hi,

My email queue stops working two weeks ago, after upgrading to 9.1.7. The problem appears with this commit https://github.com/frappe/frappe/commit/e4ff0444b2367d6b31dad0560d3a575c73bda0c7 , as if a undo the changes, the email queue works again.

The problem is with accented letters in sender name.

This is a working message:

```
Content-Type: multipart/mixed; boundary="===============4002641657218455011=="
MIME-Version: 1.0
Message-Id: <20171013145937.9162.64087.mvEb254Qvp@mysite>
X-Original-From: Juan F Fernández <juan@mysite>
From: Juan F Fernández <web@mysite>
X-Frappe-Site: https://mysite
CC: 
To: juan@mysite
Date: Fri, 13 Oct 2017 14:59:42 -0000
Reply-To: juan@mysite
Subject: Factura de venta: SINV-00424
```

This other one is a NOT working message:

```
Content-Type: multipart/mixed; boundary="===============5441701803249546227=="
MIME-Version: 1.0
Message-Id: <20171013130655.8187.76781.xfBhkjWm10@mysite>
X-Original-From: =?utf-8?q?Juan_F_Fern=C3=A1ndez_=3Cjuan=40mysite=2Ee?=
 =?utf-8?q?u=3E?=
From: =?utf-8?q?Juan_F_Fern=C3=A1ndez_=3Cweb=mysite=2Eeu=3E?=
X-Frappe-Site: https://mysite
CC: 
To: juan@mysite
Date: Fri, 13 Oct 2017 13:07:00 -0000
Reply-To: juan@mysite
Subject: Factura de venta: SINV-00424
```


Best regards,
Juan


Discussion:

Resolving patch:
diff --git a/frappe/email/email_body.py b/frappe/email/email_body.py
--- a/frappe/email/email_body.py
+++ b/frappe/email/email_body.py
@@ -10,6 +10,7 @@
 import email.utils
 from six import iteritems, text_type, string_types
 from email.mime.multipart import MIMEMultipart
+from email.header import Header
 
 
 def get_email(recipients, sender='', msg='', subject='[No Subject]',
@@ -183,7 +184,7 @@ def replace_sender(self):
 		if cint(self.email_account.always_use_account_email_id_as_sender):
 			self.set_header('X-Original-From', self.sender)
 			sender_name, sender_email = parse_addr(self.sender)
-			self.sender = email.utils.formataddr((sender_name or self.email_account.name, self.email_account.email_id))
+			self.sender = email.utils.formataddr((str(Header(sender_name or self.email_account.name, 'utf-8')), self.email_account.email_id))
 
 	def set_message_id(self, message_id, is_notification=False):
 		if message_id:


Test patch:
Repository: frappe/frappe

Issue:
cannot import name 'clear_defaults_cache'
hi @netchampfaris 

I am getting the below error while doing bench update due to this PR #11285

```
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 99, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 26, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 280, in migrate
    from frappe.migrate import migrate
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 16, in <module>
    from frappe.cache_manager import clear_global_cache
  File "/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py", line 7, in <module>
    import frappe.defaults
  File "/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py", line 7, in <module>
    from frappe.cache_manager import clear_defaults_cache, common_default_keys
ImportError: cannot import name 'clear_defaults_cache'
```


Discussion:

Resolving patch:
diff --git a/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py b/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py
--- a/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py
+++ b/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py
@@ -22,7 +22,7 @@ def validate(self):
 			aws_secret_access_key=self.get_password('secret_access_key'),
 		)
 
-		bucket_lower = str(self.bucket).lower()
+		bucket_lower = str(self.bucket)
 
 		try:
 			conn.list_buckets()


Test patch:
Repository: frappe/frappe

Issue:
`Insufficient Permission for Chat Profile` on load
Use Case:

1. Create New User without System Manager Role
2. Log-in to System
3. Error Pops-up when system is trying to create Chat Profile.

I tried replicating it to a user that was once has a System Manager role and it was not popping up. It was because the user has already Chat Profile.

Here is the log. Hope this helps!

![profile](https://user-images.githubusercontent.com/21003054/35091472-ba84aa68-fc77-11e7-860e-789961c1a09e.png)


Any help is greatly appreciated. I will also try to create an issue for this here in discuss.

Thanks,

Dori


Discussion:
Hi, what role did you assign to the user ?
@achillesrasquinha Below is the assigned role for this user.

![user role](https://user-images.githubusercontent.com/21003054/35095604-fbefda0c-fc83-11e7-877f-d9e0ab79e7db.png)


Resolving patch:
diff --git a/frappe/chat/doctype/chat_profile/chat_profile.py b/frappe/chat/doctype/chat_profile/chat_profile.py
--- a/frappe/chat/doctype/chat_profile/chat_profile.py
+++ b/frappe/chat/doctype/chat_profile/chat_profile.py
@@ -82,7 +82,7 @@ def create(user, exists_ok = False, fields = None):
     else:
         dprof      = frappe.new_doc('Chat Profile')
         dprof.user = user
-        dprof.save()
+        dprof.save(ignore_permissions = True)
 
     profile = get(user, fields = fields)
 


Test patch:
Repository: frappe/frappe

Issue:
Email Copy Issue
> "Whenever we send emails of any documents (eg. to customers), and we tick "Send me a copy", it appears that ERPNext not only cc's the user into the email, but ALSO bcc's the user. The end result is that the user gets 2 (TWO) copies of the email each time. This problem has only occurred since the upgrade to ver 10."


Discussion:

Resolving patch:
diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py
--- a/frappe/core/doctype/communication/email.py
+++ b/frappe/core/doctype/communication/email.py
@@ -374,9 +374,6 @@ def get_bcc(doc, recipients=None, fetched_from_email_account=False):
 			bcc.append(get_owner_email(doc))
 			bcc += get_assignees(doc)
 
-	if getattr(doc, "send_me_a_copy", False) and doc.sender not in bcc:
-		bcc.append(doc.sender)
-
 	if bcc:
 		exclude = []
 		exclude += [d[0] for d in frappe.db.get_all("User", ["name"], {"thread_notify": 0}, as_list=True)]


Test patch:
Repository: frappe/frappe

Issue:
Auto Email Report Should be fetched from site_config
#### Expected Behaviour
Adding the `max_reports_per_user` field in site_config should be fetched for Auto Email Report limit instead of the static 3 used currently.

Reference: https://discuss.erpnext.com/t/auto-email-report-why-there-is-a-limit-of-3-user-field/23296/4

Frappé version: 10.0.16



Discussion:

Resolving patch:
diff --git a/frappe/email/doctype/auto_email_report/auto_email_report.py b/frappe/email/doctype/auto_email_report/auto_email_report.py
--- a/frappe/email/doctype/auto_email_report/auto_email_report.py
+++ b/frappe/email/doctype/auto_email_report/auto_email_report.py
@@ -12,7 +12,7 @@
 from frappe.utils.xlsxutils import make_xlsx
 from frappe.utils.csvutils import to_csv
 
-max_reports_per_user = 3
+max_reports_per_user = frappe.local.conf.max_reports_per_user or 3
 
 class AutoEmailReport(Document):
 	def autoname(self):


Test patch:
Repository: frappe/frappe

Issue:
[Blog] Image Meta Tags Not Generated Properly
#### Expected Behaviour
When meta tags are created for a blog, the image tags should contain link to the image.

#### Actual Behaviour
When the image meta tags are generated, it assigns "name" to it.
eg: domain.name/image instead of domain.name/filename.png

Frappé version: 
 v11.x.x-develop (ebde145) (develop)



Discussion:

Resolving patch:
diff --git a/frappe/website/context.py b/frappe/website/context.py
--- a/frappe/website/context.py
+++ b/frappe/website/context.py
@@ -197,5 +197,4 @@ def add_metatags(context):
 		if tags.get("description"):
 			tags["og:description"] = tags["twitter:description"] = tags["description"]
 		if tags.get("image"):
-			tags["og:image"] = tags["twitter:image:src"] = tags["image"] = frappe.utils.get_url("image")
-        
+			tags["og:image"] = tags["twitter:image:src"] = tags["image"] = frappe.utils.get_url(tags.get("image"))


Test patch:
Repository: frappe/frappe

Issue:
[Bug] Empty rows in select fields..
After update to v10.1.46 I noted appearing of empty rows in some of select fields in custom doctypes
... even after I deleted these empty fields from field Option, they back automatically.

![untitled](https://user-images.githubusercontent.com/23026263/45253604-6c51b700-b36a-11e8-9646-26b77aec7f98.png)
 The issue noted by other developer in the following topic: 
https://discuss.erpnext.com/t/select-field-auto-create-spaces-options/40557


Discussion:

Resolving patch:
diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py
--- a/frappe/core/doctype/doctype/doctype.py
+++ b/frappe/core/doctype/doctype/doctype.py
@@ -186,7 +186,7 @@ def scrub_options_in_select(self):
 				for option in field.options.split("\n"):
 					new_options += option.strip()
 					new_options += "\n"
-				new_options.rstrip("\n")
+				new_options = new_options.rstrip("\n")
 				field.options = new_options
 
 	def validate_series(self, autoname=None, name=None):


Test patch:
Repository: frappe/frappe

Issue:
"StartTLS is not supported"-Bug in LDAP integrations
`self` is used in the method `authenticate_ldap_user` which results in the Python exception:
```
NameError: global name 'self' is not defined
```
https://github.com/frappe/frappe/blob/6811f0345e35ea521942db4b29425dd71e403ab8/frappe/integrations/doctype/ldap_settings/ldap_settings.py#L89

Since all exceptions are caught regardless their type, a misleading "StartTLS is not supported" error is thrown:
https://github.com/frappe/frappe/blob/6811f0345e35ea521942db4b29425dd71e403ab8/frappe/integrations/doctype/ldap_settings/ldap_settings.py#L95


Discussion:

Resolving patch:
diff --git a/frappe/integrations/doctype/ldap_settings/ldap_settings.py b/frappe/integrations/doctype/ldap_settings/ldap_settings.py
--- a/frappe/integrations/doctype/ldap_settings/ldap_settings.py
+++ b/frappe/integrations/doctype/ldap_settings/ldap_settings.py
@@ -86,7 +86,7 @@ def authenticate_ldap_user(user=None, password=None):
 	try:
 		try:
 			# set TLS settings for secure connection
-			if self.ssl_tls_mode == 'StartTLS':
+			if settings.ssl_tls_mode == 'StartTLS':
 				conn.set_option(ldap.OPT_X_TLS_DEMAND, True)
 				if self.require_trusted_certificate == 'Yes':
 					conn.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)


Test patch:
Repository: frappe/frappe

Issue:
Hard coded localhost for pgsql setup
The postgresql setup is using `localhost` instead of the `db_host` from the site configuration:
https://github.com/frappe/frappe/blob/17c43b4e1d2506e5b1498e52f3aa6c81277d67be/frappe/database/postgres/setup_db.py#L20

This makes it impossible to use Postgres on a remote host :/

I can try to provide a PR for that.
I do not guaranty I will have the time to test it but it's fairly simple.


Discussion:

Resolving patch:
diff --git a/frappe/database/postgres/setup_db.py b/frappe/database/postgres/setup_db.py
--- a/frappe/database/postgres/setup_db.py
+++ b/frappe/database/postgres/setup_db.py
@@ -17,7 +17,7 @@ def setup_database(force, source_sql, verbose):
 	subprocess_env['PGPASSWORD'] = str(frappe.conf.db_password)
 	# bootstrap db
 	subprocess.check_output([
-		'psql', frappe.conf.db_name, '-h', 'localhost', '-U',
+		'psql', frappe.conf.db_name, '-h', frappe.conf.db_host, '-U',
 		frappe.conf.db_name, '-f',
 		os.path.join(os.path.dirname(__file__), 'framework_postgres.sql')
 	], env=subprocess_env)


Test patch:
diff --git a/test_sites/test_site_postgres/site_config.json b/test_sites/test_site_postgres/site_config.json
--- a/test_sites/test_site_postgres/site_config.json
+++ b/test_sites/test_site_postgres/site_config.json
@@ -1,4 +1,5 @@
 {
+ "db_host": "localhost",
  "db_name": "test_frappe",
  "db_password": "test_frappe",
  "db_type": "postgres",
Repository: frappe/frappe

Issue:
bug(API): TypeError, cannot create document 

```bash
curl -X POST https://my.erpnext.com/api/resource/Lead \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==' \
  -H 'Content-Type: application/json' \
  -d '{"lead_name": "Jon Doe"}'
```

Returns

```json
{"exc":"[\"Traceback (most recent call last):\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/app.py\\\", line 60, in application\\n    response = frappe.api.handle()\\n  File \\\"/home/frappe/frappe-bench/apps/frappe/frappe/api.py\\\", line 116, in handle\\n    data = json.loads(frappe.local.form_dict.data)\\n  File \\\"/usr/lib64/python2.7/json/__init__.py\\\", line 338, in loads\\n    return _default_decoder.decode(s)\\n  File \\\"/usr/lib64/python2.7/json/decoder.py\\\", line 366, in decode\\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\\nTypeError: expected string or buffer\\n\"]"}
```

Cleaned up stack trace:

```
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 60, in application
	response = frappe.api.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 116, in handle
	data = json.loads(frappe.local.form_dict.data)
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
	return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
	obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer
```

This seems to apply to any DocType – it's not possible to create documents this way.

@netchampfaris may [this](https://github.com/frappe/frappe/commit/f63ad574e580360996807931f9c9cfa363385c3d#diff-d65e8dff7122e8822cd2009d1ef1a963) be the cause?

### Versions
ERPNext: v12.0.6 (version-12)
Frappe Framework: v12.0.6 (version-12)


Discussion:

Resolving patch:
diff --git a/frappe/api.py b/frappe/api.py
--- a/frappe/api.py
+++ b/frappe/api.py
@@ -113,7 +113,10 @@ def handle():
 							doctype, **frappe.local.form_dict)})
 
 				if frappe.local.request.method=="POST":
-					data = json.loads(frappe.local.form_dict.data)
+					if frappe.local.form_dict.data is None:
+						data = json.loads(frappe.local.request.get_data())
+					else:
+						data = json.loads(frappe.local.form_dict.data)
 					data.update({
 						"doctype": doctype
 					})


Test patch: