diff --git a/recruitment/__pycache__/models.cpython-312.pyc b/recruitment/__pycache__/models.cpython-312.pyc index c63aa49..5f50140 100644 Binary files a/recruitment/__pycache__/models.cpython-312.pyc and b/recruitment/__pycache__/models.cpython-312.pyc differ diff --git a/recruitment/__pycache__/views_frontend.cpython-312.pyc b/recruitment/__pycache__/views_frontend.cpython-312.pyc index 72a41e0..cfe62c9 100644 Binary files a/recruitment/__pycache__/views_frontend.cpython-312.pyc and b/recruitment/__pycache__/views_frontend.cpython-312.pyc differ diff --git a/recruitment/models.py b/recruitment/models.py index 0e4f3cf..4d545ec 100644 --- a/recruitment/models.py +++ b/recruitment/models.py @@ -321,23 +321,23 @@ class JobPosting(Base): def all_candidates_count(self): return self.candidates.annotate( sortable_score=Cast('ai_analysis_data__match_score', output_field=CharField())).order_by( - '-sortable_score').count() + '-sortable_score').count() or 0 @property def screening_candidates_count(self): - return self.all_candidates.filter(stage="Applied").count() + return self.all_candidates.filter(stage="Applied").count() or 0 @property def exam_candidates_count(self): - return self.all_candidates.filter(stage="Exam").count() + return self.all_candidates.filter(stage="Exam").count() or 0 @property def interview_candidates_count(self): - return self.all_candidates.filter(stage="Interview").count() + return self.all_candidates.filter(stage="Interview").count() or 0 @property def offer_candidates_count(self): - return self.all_candidates.filter(stage="Offer").count() + return self.all_candidates.filter(stage="Offer").count() or 0 @property def vacancy_fill_rate(self): diff --git a/recruitment/views_frontend.py b/recruitment/views_frontend.py index 2055fde..4e97d0e 100644 --- a/recruitment/views_frontend.py +++ b/recruitment/views_frontend.py @@ -339,6 +339,8 @@ class TrainingDeleteView(LoginRequiredMixin, SuccessMessageMixin, DeleteView): @login_required def dashboard_view(request): + all_candidates_count=0 + # --- Performance Optimization: Aggregate Data in ONE Query --- # 1. Base Job Query: Get all jobs and annotate with candidate count @@ -393,27 +395,33 @@ def dashboard_view(request): sortable_score__gte=75 ).count() high_potential_ratio = round((high_potential_count / total_candidates) * 100, 1) if total_candidates > 0 else 0 - + jobs=models.JobPosting.objects.all().order_by('internal_job_id') selected_job_pk=request.GET.get('selected_job_pk','') candidate_stage=['APPLIED','EXAM','INTERVIEW','OFFER'] apply_count,exam_count,interview_count,offer_count=[0]*4 if selected_job_pk: - job=jobs.get(pk=selected_job_pk) - apply_count=job.screening_candidates_count - exam_count=job.exam_candidates_count - interview_count=job.interview_candidates_count - offer_count=job.offer_candidates_count - all_candidates_count=job.all_candidates_count + try: + job=jobs.get(pk=selected_job_pk) + apply_count=job.screening_candidates_count + exam_count=job.exam_candidates_count + interview_count=job.interview_candidates_count + offer_count=job.offer_candidates_count + all_candidates_count=job.all_candidates_count + except Exception as e: + print(e) else: #default job - job=jobs.first() - apply_count=job.screening_candidates_count - exam_count=job.exam_candidates_count - interview_count=job.interview_candidates_count - offer_count=job.offer_candidates_count - all_candidates_count=job.all_candidates_count + try: + job=jobs.first() + apply_count=job.screening_candidates_count + exam_count=job.exam_candidates_count + interview_count=job.interview_candidates_count + offer_count=job.offer_candidates_count + all_candidates_count=job.all_candidates_count + except Exception as e: + print(e) candidates_count=[ apply_count,exam_count,interview_count,offer_count ] context = { diff --git a/templates/account/email/email_confirmation_message.txt b/templates/account/email/email_confirmation_message.txt new file mode 100644 index 0000000..5dd0cb4 --- /dev/null +++ b/templates/account/email/email_confirmation_message.txt @@ -0,0 +1,18 @@ +{% load account i18n %} +{% autoescape off %} + +{% blocktrans %}Hello,{% endblocktrans %} + +{% blocktrans %}To verify the ownership of your email address, please click the confirmation link below:{% endblocktrans %} + + +{% trans "Confirm My KAAUH ATS Email" %} +{{ activate_url }} + + +{% blocktrans %}If you did not request this verification, you can safely ignore this email.{% endblocktrans %} + +{% blocktrans %}Alternatively, copy and paste this link into your browser:{% endblocktrans %} +{{ activate_url }} + +{% endautoescape %} \ No newline at end of file diff --git a/templates/account/email/password_reset_key_message.txt b/templates/account/email/password_reset_key_message.txt new file mode 100644 index 0000000..7930487 --- /dev/null +++ b/templates/account/email/password_reset_key_message.txt @@ -0,0 +1,27 @@ +{% load i18n %} +{% load static %} +{% autoescape off %} + +{% trans "Password Reset Request" %} + +{% trans "Hello," %} + +{% blocktrans %}You are receiving this email because you or someone else has requested a password reset for your account at{% endblocktrans %} {{ current_site.name }}. + +------------------------------------------------------ +{% trans "Click Here to Reset Your Password" %} +{{ password_reset_url }} +------------------------------------------------------ + +{% trans "This link is only valid for a limited time." %} + +{% trans "If you did not request a password reset, please ignore this email. Your password will remain unchanged." %} + +{% trans "Thank you," %} +{% trans "KAAUH ATS Team" %} + +--- +{% trans "If the button above does not work, copy and paste the following link into your browser:" %} +{{ password_reset_url }} + +{% endautoescape %} \ No newline at end of file diff --git a/templates/account/login.html b/templates/account/login.html index b7e66c7..5cf52e8 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -1,6 +1,8 @@ -{% load static %} +{% load static i18n %} +{% get_current_language_bidi as LANGUAGE_BIDI %} +{% get_current_language as LANGUAGE_CODE %} - +
@@ -146,34 +148,34 @@