Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2025-12-09 13:13:19.795660",
"modified": "2026-01-16 11:18:59.831791",
"modified_by": "Administrator",
"module": "Zoom Integration",
"name": "Zoom Webinar Registration",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) 2026, Build With Hussain and contributors
// For license information, please see license.txt

frappe.query_reports["Registration Report"] = {
filters: [
{
fieldname: "webinar",
label: __("Webinar"),
fieldtype: "Link",
options: "Zoom Webinar",
reqd: 1,
},
],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"add_total_row": 0,
"add_translate_data": 0,
"columns": [],
"creation": "2026-01-17 16:43:07.141951",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"json": "{}",
"letter_head": null,
"modified": "2026-01-17 16:53:48.908719",
"modified_by": "Administrator",
"module": "Zoom Integration",
"name": "Registration Report",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Zoom Webinar Registration",
"report_name": "Registration Report",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "Zoom Manager"
}
],
"timeout": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Copyright (c) 2026, Build With Hussain
# For license information, please see license.txt

import frappe
from frappe import _


def execute(filters=None):
columns = get_columns()
data = get_data(filters or {})
return columns, data


def get_columns():
return [
{
"label": _("User Email"),
"fieldname": "user",
"fieldtype": "Data",
"width": 200,
},
Comment on lines +16 to +21
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Column label mismatch with actual data.

The label says "User Email" but the fieldname user fetches the user field from Zoom Webinar Registration, which is a Link to the User doctype (not the email address itself). The DocType has a separate email field that contains the actual email.

Consider either:

  1. Change the label to "User" to match the actual data, or
  2. Fetch zwreg.email in the SQL query if you want to display the email address
Option 1: Fix the label
 		{
-			"label": _("User Email"),
+			"label": _("User"),
 			"fieldname": "user",
-			"fieldtype": "Data",
+			"fieldtype": "Link",
+			"options": "User",
 			"width": 200,
 		},
Option 2: Fetch email instead

Update the column definition:

 		{
 			"label": _("User Email"),
-			"fieldname": "user",
+			"fieldname": "email",
 			"fieldtype": "Data",
 			"width": 200,
 		},

And update the SQL query in get_data():

-			zwreg.user,
+			zwreg.email,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"label": _("User Email"),
"fieldname": "user",
"fieldtype": "Data",
"width": 200,
},
{
"label": _("User"),
"fieldname": "user",
"fieldtype": "Link",
"options": "User",
"width": 200,
},
🤖 Prompt for AI Agents
In
`@zoom_integration/zoom_integration/report/registration_report/registration_report.py`
around lines 16 - 21, The column label "User Email" doesn't match the linked
user field "user" from the Zoom Webinar Registration doctype; either rename the
column label to "User" to reflect the existing field, or change the report to
select the actual email by updating get_data() to join/select zwreg.email and
keep the label "User Email"; locate the column definition with "fieldname":
"user" and the get_data() SQL/query function and apply one of these two fixes
accordingly.

{
"label": _("First Name"),
"fieldname": "first_name",
"fieldtype": "Data",
"width": 180,
},
{
"label": _("Last Name"),
"fieldname": "last_name",
"fieldtype": "Data",
"width": 180,
},
{
"label": _("Synced from Zoom"),
"fieldname": "synced_from_zoom",
"fieldtype": "Check",
"width": 200,
},
{
"label": _("Auto Registered"),
"fieldname": "custom_auto_registered",
"fieldtype": "Check",
"width": 200,
},
{
"label": _("Registrant ID"),
"fieldname": "registrant_id",
"fieldtype": "Data",
"width": 200,
},
{
"label": _("Join URL"),
"fieldname": "join_url",
"fieldtype": "Data",
"width": 200,
},
{
"label": _("UTM Source"),
"fieldname": "utm_source",
"fieldtype": "Data",
"width": 120,
},
{
"label": _("UTM Medium"),
"fieldname": "utm_medium",
"fieldtype": "Data",
"width": 120,
},
{
"label": _("UTM Campaign"),
"fieldname": "utm_campaign",
"fieldtype": "Data",
"width": 150,
},
{
"label": _("UTM Term"),
"fieldname": "utm_term",
"fieldtype": "Data",
"width": 120,
},
{
"label": _("UTM Content"),
"fieldname": "utm_content",
"fieldtype": "Data",
"width": 120,
},
]


def get_data(filters):
values = {"webinar": filters.get("webinar")}

# Base registration data
query = """
SELECT
zwreg.name AS registration,
zwreg.user,
zwreg.first_name,
zwreg.last_name,
zwreg.synced_from_zoom,
zwreg.registrant_id,
zwreg.join_url,
zwreg.custom_auto_registered
FROM `tabZoom Webinar Registration` zwreg
WHERE zwreg.webinar = %(webinar)s
ORDER BY zwreg.user
"""

records = frappe.db.sql(query, values, as_dict=True)

if not records:
return []

registration_names = [r["registration"] for r in records]

# Fetch UTM parameters
utm_query = """
SELECT
parent,
`key`,
value
FROM `tabUtm Parameters`
WHERE
parenttype = 'Zoom Webinar Registration'
AND parent IN %(parents)s
"""
Comment on lines +118 to +127
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for Utm Parameters doctype definition and references
echo "=== Searching for Utm Parameters references ==="
rg "Utm Parameters" --type=py --type=json -n

echo ""
echo "=== Searching for utm-related files ==="
fd "utm" -i

echo ""
echo "=== Looking for Zoom Webinar Registration doctype definition ==="
fd "zoom.*webinar.*registration" -i

Repository: BuildWithHussain/zoom_integration

Length of output: 810


🏁 Script executed:

cat zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.json

Repository: BuildWithHussain/zoom_integration

Length of output: 3765


🏁 Script executed:

#!/bin/bash
# Search for any utm-related doctype or field definition
rg -i "utm" --type=json --type=py -n

echo ""
echo "=== Searching for all table field definitions that use Table fieldtype ==="
rg "\"Table\"" --type=json -B 5 | grep -E "(fieldname|options|Table)" | head -40

Repository: BuildWithHussain/zoom_integration

Length of output: 3574


🏁 Script executed:

#!/bin/bash
# Find all doctype definitions
echo "=== All DocTypes in the repository ==="
find zoom_integration -name "*.json" -path "*/doctype/*" | grep -v test | xargs -I {} sh -c 'grep -l "\"doctype\": \"DocType\"" {} && echo "File: {}"' 2>/dev/null | grep -v "^File:" | sort

echo ""
echo "=== Check if Utm Parameters doctype exists ==="
find zoom_integration -name "*utm*.json" -o -name "*Utm*.json" 2>/dev/null

echo ""
echo "=== List all doctype directories ==="
ls -1 zoom_integration/zoom_integration/doctype/

Repository: BuildWithHussain/zoom_integration

Length of output: 903


🏁 Script executed:

cat zoom_integration/zoom_integration/doctype/zoom_webinar_additional_param/zoom_webinar_additional_param.json

Repository: BuildWithHussain/zoom_integration

Length of output: 1018


tabUtm Parameters table does not exist in the codebase.

The query will fail at runtime. The codebase only defines 6 DocTypes, and "Utm Parameters" is not among them. Either create this DocType as a child table for Zoom Webinar Registration, or refactor to use the existing "Zoom Webinar Additional Param" table (which already stores key-value pairs) for UTM data.

🤖 Prompt for AI Agents
In
`@zoom_integration/zoom_integration/report/registration_report/registration_report.py`
around lines 118 - 127, The SQL in utm_query references a non-existent child
table 'tabUtm Parameters' so the query will fail; update the code to use the
existing child table used for key/value pairs (e.g., 'tabZoom Webinar Additional
Param') or create a new DocType named "Utm Parameters" as a child of Zoom
Webinar Registration. If refactoring, change utm_query to select parent, `key`,
value FROM the existing child table and keep the same WHERE clauses (parenttype
= 'Zoom Webinar Registration' AND parent IN %(parents)s), and confirm the field
names (`key` and value) match the actual fields on the "Zoom Webinar Additional
Param" DocType; if you create the DocType, ensure it's defined as a child table
linked to Zoom Webinar Registration with the expected fields so the existing
utm_query can run unchanged.


utm_rows = frappe.db.sql(
utm_query,
{"parents": tuple(registration_names)},
as_dict=True,
)

utm_map = {}
for row in utm_rows:
utm_map.setdefault(row.parent, {})[row.key] = row.value

# Merge UTM data into records
for record in records:
utm = utm_map.get(record["registration"], {})
record["utm_source"] = utm.get("utm_source", "")
record["utm_medium"] = utm.get("utm_medium", "")
record["utm_campaign"] = utm.get("utm_campaign", "")
record["utm_term"] = utm.get("utm_term", "")
record["utm_content"] = utm.get("utm_content", "")

# Cleanup
record.pop("registration", None)

return records