Skip to content

Commit

Permalink
Merge pull request #672 from pateljannat/user-category-default
Browse files Browse the repository at this point in the history
fix: default user category
  • Loading branch information
pateljannat authored Nov 6, 2023
2 parents 0488ae8 + 929f97c commit 014b85f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lms/fixtures/custom_field.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@
"label": "User Category",
"length": 0,
"mandatory_depends_on": null,
"modified": "2022-04-19 13:02:18.219508",
"modified": "2022-04-19 13:02:18.219510",
"module": "LMS",
"name": "User-user_category",
"no_copy": 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,
"precision": "",
"print_hide": 0,
Expand Down
6 changes: 5 additions & 1 deletion lms/lms/doctype/invite_request/invite_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

class InviteRequest(Document):
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()

def create_user(self, password):
Expand Down
3 changes: 2 additions & 1 deletion lms/lms/doctype/lms_certificate/lms_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def validate(self):
self.validate_duplicate_certificate()

def after_insert(self):
self.send_mail()
if not frappe.flags.in_test:
self.send_mail()

def send_mail(self):
subject = _("Congratulations on getting certified!")
Expand Down

0 comments on commit 014b85f

Please sign in to comment.