Skip to content

Commit f72dcef

Browse files
committed
fix semgrep issues
1 parent ece33c9 commit f72dcef

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

frappe_gmail_thread/api/activity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_attachments_data(email):
1616

1717

1818
@frappe.whitelist()
19-
def get_linked_gmail_threads(doctype, docname):
19+
def get_linked_gmail_threads(doctype: str, docname: str):
2020
gmail_threads = frappe.get_all(
2121
"Gmail Thread",
2222
filters={
@@ -83,7 +83,7 @@ def get_linked_gmail_threads(doctype, docname):
8383

8484

8585
@frappe.whitelist()
86-
def relink_gmail_thread(name, doctype, docname):
86+
def relink_gmail_thread(name: str, doctype: str, docname: str):
8787
thread = frappe.get_doc("Gmail Thread", name)
8888
thread.reference_doctype = doctype
8989
thread.reference_name = docname
@@ -92,7 +92,7 @@ def relink_gmail_thread(name, doctype, docname):
9292

9393

9494
@frappe.whitelist()
95-
def unlink_gmail_thread(name):
95+
def unlink_gmail_thread(name: str):
9696
thread = frappe.get_doc("Gmail Thread", name)
9797
thread.reference_doctype = None
9898
thread.reference_name = None

frappe_gmail_thread/api/oauth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def get_authentication_url(client_id=None, redirect_uri=None):
2020

2121

2222
@frappe.whitelist()
23-
def get_auth_url(doc):
23+
def get_auth_url(doc: str):
2424
current_user = frappe.session.user
2525
current_user = frappe.get_doc("User", current_user)
2626
try:
@@ -115,7 +115,7 @@ def authorize_access(user, code=None, reauthorize=None):
115115

116116

117117
@frappe.whitelist()
118-
def callback(code):
118+
def callback(code: str):
119119
"""
120120
Authorization code is sent to callback as per the API configuration
121121
"""

frappe_gmail_thread/api/pubsub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from frappe.utils.background_jobs import is_job_enqueued
66

77

8-
@frappe.whitelist(allow_guest=True)
8+
@frappe.whitelist(allow_guest=True) # nosemgrep
99
def callback():
1010
data = frappe.request.get_data(as_text=True)
1111
data = frappe.parse_json(data)

frappe_gmail_thread/frappe_gmail_thread/doctype/gmail_thread/gmail_thread.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def before_save(self):
9191

9292

9393
@frappe.whitelist(methods=["POST"])
94-
def sync_labels(account_name, should_save=True):
94+
def sync_labels(account_name: str, should_save: bool = True):
9595
if isinstance(account_name, str):
9696
gmail_account = frappe.get_doc("Gmail Account", account_name)
9797
else:
@@ -116,7 +116,7 @@ def sync_labels(account_name, should_save=True):
116116

117117
def sync(user=None):
118118
if user:
119-
frappe.set_user(user)
119+
frappe.set_user(user) # nosemgrep:
120120
user = frappe.session.user
121121
gmail_account = frappe.get_doc("Gmail Account", {"linked_user": user})
122122
if not gmail_account.gmail_enabled:

0 commit comments

Comments
 (0)