feat: added patch for is unique
This commit is contained in:
parent
9402813276
commit
77d2c3d8cf
3 changed files with 25 additions and 6 deletions
|
|
@ -278,3 +278,4 @@ frappe.patches.v13_0.set_path_for_homepage_in_web_page_view
|
|||
frappe.patches.v13_0.migrate_translation_column_data
|
||||
frappe.patches.v13_0.set_read_times
|
||||
frappe.patches.v13_0.remove_web_view
|
||||
frappe.patches.v13_0.set_unique_for_page_view
|
||||
6
frappe/patches/v13_0/set_unique_for_page_view.py
Normal file
6
frappe/patches/v13_0/set_unique_for_page_view.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc('website', 'doctype', 'web_page_view', force=True)
|
||||
site_url = frappe.utils.get_site_url(frappe.local.site)
|
||||
frappe.db.sql("""UPDATE `tabWeb Page View` set is_unique=1 where referrer LIKE '%{0}%'""".format(site_url))
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"creation": "2020-04-15 22:54:46.009703",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
|
|
@ -9,7 +10,9 @@
|
|||
"referrer",
|
||||
"browser",
|
||||
"browser_version",
|
||||
"date"
|
||||
"is_unique",
|
||||
"time_zone",
|
||||
"user_agent"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
|
|
@ -39,15 +42,24 @@
|
|||
"set_only_once": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Datetime",
|
||||
"label": "Date",
|
||||
"set_only_once": 1
|
||||
"fieldname": "is_unique",
|
||||
"fieldtype": "Data",
|
||||
"label": "Is Unique"
|
||||
},
|
||||
{
|
||||
"fieldname": "time_zone",
|
||||
"fieldtype": "Data",
|
||||
"label": "Time Zone"
|
||||
},
|
||||
{
|
||||
"fieldname": "user_agent",
|
||||
"fieldtype": "Data",
|
||||
"label": "User Agent"
|
||||
}
|
||||
],
|
||||
"in_create": 1,
|
||||
"links": [],
|
||||
"modified": "2020-04-15 23:31:27.517793",
|
||||
"modified": "2020-05-05 14:11:24.718770",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Website",
|
||||
"name": "Web Page View",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue