diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index c0d306f70f..64982c5707 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -131,7 +131,7 @@ { "fieldname": "middle_name", "fieldtype": "Data", - "label": "Middle Name (Optional)", + "label": "Middle Name", "oldfieldname": "middle_name", "oldfieldtype": "Data" }, @@ -496,7 +496,7 @@ { "description": "Restrict user from this IP address only. Multiple IP addresses can be added by separating with commas. Also accepts partial IP addresses like (111.111.111)", "fieldname": "restrict_ip", - "fieldtype": "Data", + "fieldtype": "Small Text", "label": "Restrict IP", "permlevel": 1 }, @@ -753,7 +753,7 @@ "link_fieldname": "user" } ], - "modified": "2022-08-11 14:47:04.100892", + "modified": "2022-09-19 16:05:46.485242", "modified_by": "Administrator", "module": "Core", "name": "User", diff --git a/frappe/tests/test_db_update.py b/frappe/tests/test_db_update.py index dde6639526..bbb10aec2c 100644 --- a/frappe/tests/test_db_update.py +++ b/frappe/tests/test_db_update.py @@ -40,46 +40,46 @@ class TestDBUpdate(FrappeTestCase): frappe.reload_doctype("User", force=True) frappe.model.meta.trim_tables("User") - make_property_setter(doctype, "restrict_ip", "unique", "1", "Int") + make_property_setter(doctype, "middle_name", "unique", "1", "Check") frappe.db.updatedb(doctype) - restrict_ip_in_table = get_table_column("User", "restrict_ip") - self.assertTrue(restrict_ip_in_table.unique) + middle_name_in_table = get_table_column("User", "middle_name") + self.assertTrue(middle_name_in_table.unique) - make_property_setter(doctype, "restrict_ip", "unique", "0", "Int") + make_property_setter(doctype, "middle_name", "unique", "0", "Check") frappe.db.updatedb(doctype) - restrict_ip_in_table = get_table_column("User", "restrict_ip") - self.assertFalse(restrict_ip_in_table.unique) + middle_name_in_table = get_table_column("User", "middle_name") + self.assertFalse(middle_name_in_table.unique) - make_property_setter(doctype, "restrict_ip", "search_index", "1", "Int") + make_property_setter(doctype, "middle_name", "search_index", "1", "Check") frappe.db.updatedb(doctype) - restrict_ip_in_table = get_table_column("User", "restrict_ip") - self.assertTrue(restrict_ip_in_table.index) + middle_name_in_table = get_table_column("User", "middle_name") + self.assertTrue(middle_name_in_table.index) - make_property_setter(doctype, "restrict_ip", "search_index", "0", "Int") + make_property_setter(doctype, "middle_name", "search_index", "0", "Check") frappe.db.updatedb(doctype) - restrict_ip_in_table = get_table_column("User", "restrict_ip") - self.assertFalse(restrict_ip_in_table.index) + middle_name_in_table = get_table_column("User", "middle_name") + self.assertFalse(middle_name_in_table.index) - make_property_setter(doctype, "restrict_ip", "search_index", "1", "Int") - make_property_setter(doctype, "restrict_ip", "unique", "1", "Int") + make_property_setter(doctype, "middle_name", "search_index", "1", "Check") + make_property_setter(doctype, "middle_name", "unique", "1", "Check") frappe.db.updatedb(doctype) - restrict_ip_in_table = get_table_column("User", "restrict_ip") - self.assertTrue(restrict_ip_in_table.index) - self.assertTrue(restrict_ip_in_table.unique) + middle_name_in_table = get_table_column("User", "middle_name") + self.assertTrue(middle_name_in_table.index) + self.assertTrue(middle_name_in_table.unique) - make_property_setter(doctype, "restrict_ip", "search_index", "1", "Int") - make_property_setter(doctype, "restrict_ip", "unique", "0", "Int") + make_property_setter(doctype, "middle_name", "search_index", "1", "Check") + make_property_setter(doctype, "middle_name", "unique", "0", "Check") frappe.db.updatedb(doctype) - restrict_ip_in_table = get_table_column("User", "restrict_ip") - self.assertTrue(restrict_ip_in_table.index) - self.assertFalse(restrict_ip_in_table.unique) + middle_name_in_table = get_table_column("User", "middle_name") + self.assertTrue(middle_name_in_table.index) + self.assertFalse(middle_name_in_table.unique) - make_property_setter(doctype, "restrict_ip", "search_index", "0", "Int") - make_property_setter(doctype, "restrict_ip", "unique", "1", "Int") + make_property_setter(doctype, "middle_name", "search_index", "0", "Check") + make_property_setter(doctype, "middle_name", "unique", "1", "Check") frappe.db.updatedb(doctype) - restrict_ip_in_table = get_table_column("User", "restrict_ip") - self.assertFalse(restrict_ip_in_table.index) - self.assertTrue(restrict_ip_in_table.unique) + middle_name_in_table = get_table_column("User", "middle_name") + self.assertFalse(middle_name_in_table.index) + self.assertTrue(middle_name_in_table.unique) # explicitly make a text index frappe.db.add_index(doctype, ["email_signature(200)"])