Skip to content

Commit

Permalink
Merge pull request #695 from frappe/version-14-hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal authored Jul 19, 2023
2 parents 23441e1 + 87e7e0d commit 5715200
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
steps:
- name: Update notes
run: |
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/frappe/releases/generate-notes -f tag_name=$RELEASE_TAG | jq -r '.body' | sed -E '/^\* (chore|ci|test|docs|style)/d' )
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/frappe/releases/tags/$RELEASE_TAG | jq -r '.id')
gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/frappe/releases/$RELEASE_ID -f body="$NEW_NOTES"
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/hrms/releases/generate-notes -f tag_name=$RELEASE_TAG | jq -r '.body' | sed -E '/^\* (chore|ci|test|docs|style)/d' )
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/hrms/releases/tags/$RELEASE_TAG | jq -r '.id')
gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/hrms/releases/$RELEASE_ID -f body="$NEW_NOTES"
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
'revert',
'style',
'test',
'patch',
],
],
},
Expand Down
11 changes: 9 additions & 2 deletions hrms/hr/doctype/interview/interview.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr, flt, get_datetime, get_link_to_form
from frappe.utils import cstr, flt, get_datetime, get_link_to_form, getdate, nowtime


class DuplicateInterviewRoundError(frappe.ValidationError):
Expand Down Expand Up @@ -217,8 +217,15 @@ def send_daily_feedback_reminder():
interview_feedback_template = frappe.get_doc(
"Email Template", reminder_settings.feedback_reminder_notification_template
)

interviews = frappe.get_all(
"Interview", filters={"status": ["in", ["Under Review", "Pending"]], "docstatus": ["!=", 2]}
"Interview",
filters={
"status": "Under Review",
"docstatus": ["!=", 2],
"scheduled_on": ["<=", getdate()],
"to_time": ["<=", nowtime()],
},
)

for entry in interviews:
Expand Down
15 changes: 13 additions & 2 deletions hrms/hr/doctype/interview/test_interview.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def test_notification_for_feedback_submission(self):

job_applicant = create_job_applicant()
scheduled_on = add_days(getdate(), -4)
create_interview_and_dependencies(job_applicant.name, scheduled_on=scheduled_on)
interview = create_interview_and_dependencies(
job_applicant.name, scheduled_on=scheduled_on, status="Under Review"
)

frappe.db.sql("DELETE FROM `tabEmail Queue`")
send_daily_feedback_reminder()
Expand Down Expand Up @@ -106,7 +108,13 @@ def tearDown(self):


def create_interview_and_dependencies(
job_applicant, scheduled_on=None, from_time=None, to_time=None, designation=None, save=1
job_applicant,
scheduled_on=None,
from_time=None,
to_time=None,
designation=None,
status=None,
save=True,
):
if designation:
designation = create_designation(designation_name="_Test_Sales_manager").name
Expand All @@ -128,6 +136,9 @@ def create_interview_and_dependencies(
interview.append("interview_details", {"interviewer": interviewer_1.name})
interview.append("interview_details", {"interviewer": interviewer_2.name})

if status:
interview.status = status

if save:
interview.save()

Expand Down
1 change: 1 addition & 0 deletions hrms/public/node_modules

0 comments on commit 5715200

Please sign in to comment.