Merge pull request #672 from pateljannat/user-category-default

fix: default user category
This commit is contained in:
Jannat Patel
2023-11-06 19:14:19 +05:30
committed by GitHub
3 changed files with 9 additions and 4 deletions

View File

@@ -138,12 +138,12 @@
"label": "User Category", "label": "User Category",
"length": 0, "length": 0,
"mandatory_depends_on": null, "mandatory_depends_on": null,
"modified": "2022-04-19 13:02:18.219508", "modified": "2022-04-19 13:02:18.219510",
"module": "LMS", "module": "LMS",
"name": "User-user_category", "name": "User-user_category",
"no_copy": 0, "no_copy": 0,
"non_negative": 0, "non_negative": 0,
"options": "Business Owner\nManager (Sales/Marketing/Customer)\nEmployee\nStudent\nFreelancer/Just looking\nOthers", "options": "\nBusiness Owner\nManager (Sales/Marketing/Customer)\nEmployee\nStudent\nFreelancer/Just looking\nOthers",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"print_hide": 0, "print_hide": 0,

View File

@@ -11,7 +11,11 @@ from frappe.utils.password import get_decrypted_password
class InviteRequest(Document): class InviteRequest(Document):
def on_update(self): def on_update(self):
if self.has_value_changed("status") and self.status == "Approved": if (
self.has_value_changed("status")
and self.status == "Approved"
and not frappe.flags.in_test
):
self.send_email() self.send_email()
def create_user(self, password): def create_user(self, password):

View File

@@ -14,7 +14,8 @@ class LMSCertificate(Document):
self.validate_duplicate_certificate() self.validate_duplicate_certificate()
def after_insert(self): def after_insert(self):
self.send_mail() if not frappe.flags.in_test:
self.send_mail()
def send_mail(self): def send_mail(self):
subject = _("Congratulations on getting certified!") subject = _("Congratulations on getting certified!")