diff --git a/NorahUniversity/__pycache__/settings.cpython-312.pyc b/NorahUniversity/__pycache__/settings.cpython-312.pyc index 820adf1..5d650c3 100644 Binary files a/NorahUniversity/__pycache__/settings.cpython-312.pyc and b/NorahUniversity/__pycache__/settings.cpython-312.pyc differ diff --git a/NorahUniversity/settings.py b/NorahUniversity/settings.py index 3eb57de..cecb890 100644 --- a/NorahUniversity/settings.py +++ b/NorahUniversity/settings.py @@ -66,7 +66,7 @@ INSTALLED_APPS = [ SITE_ID = 1 -LOGIN_REDIRECT_URL = '/' +LOGIN_REDIRECT_URL = 'dashboard' ACCOUNT_LOGOUT_REDIRECT_URL = '/' @@ -183,7 +183,6 @@ ACCOUNT_LOGIN_METHODS = ['email'] ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*', 'password2*'] ACCOUNT_UNIQUE_EMAIL = True -ACCOUNT_EMAIL_VERIFICATION = 'none' ACCOUNT_USER_MODEL_USERNAME_FIELD = None ACCOUNT_EMAIL_VERIFICATION = "mandatory" ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True @@ -196,7 +195,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # Crispy Forms Configuration CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" -CRISPY_TEMPLATE_PACK = "bootstrap5" +CRISPY_TEMPLATE_PACK = "bootstrapconsole5" # Bootstrap 5 Configuration CRISPY_BS5 = { diff --git a/recruitment/__pycache__/forms.cpython-312.pyc b/recruitment/__pycache__/forms.cpython-312.pyc index 2c25944..9c3d6af 100644 Binary files a/recruitment/__pycache__/forms.cpython-312.pyc and b/recruitment/__pycache__/forms.cpython-312.pyc differ diff --git a/recruitment/__pycache__/models.cpython-312.pyc b/recruitment/__pycache__/models.cpython-312.pyc index 853b30c..a2a7d03 100644 Binary files a/recruitment/__pycache__/models.cpython-312.pyc and b/recruitment/__pycache__/models.cpython-312.pyc differ diff --git a/recruitment/__pycache__/urls.cpython-312.pyc b/recruitment/__pycache__/urls.cpython-312.pyc index cdcde39..9e1e55a 100644 Binary files a/recruitment/__pycache__/urls.cpython-312.pyc and b/recruitment/__pycache__/urls.cpython-312.pyc differ diff --git a/recruitment/__pycache__/views.cpython-312.pyc b/recruitment/__pycache__/views.cpython-312.pyc index d32b218..382a143 100644 Binary files a/recruitment/__pycache__/views.cpython-312.pyc and b/recruitment/__pycache__/views.cpython-312.pyc differ diff --git a/recruitment/__pycache__/views_frontend.cpython-312.pyc b/recruitment/__pycache__/views_frontend.cpython-312.pyc index d448ee0..04d5aa8 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 18d9c0e..ad673b9 100644 --- a/recruitment/models.py +++ b/recruitment/models.py @@ -702,14 +702,11 @@ class Candidate(Base): @property def time_to_hire_days(self): - - if self.hired_date: - time_to_hire_in_days=timedelta(self.hired_date-self.created_at.date()) - print(self.created_at.date) - return time_to_hire_in_days + if self.hired_date and self.created_at: + time_to_hire = self.hired_date - self.created_at.date() + return time_to_hire.days return 0 - class TrainingMaterial(Base): title = models.CharField(max_length=255, verbose_name=_("Title")) content = CKEditor5Field(blank=True, verbose_name=_("Content"),config_name='extends') diff --git a/recruitment/urls.py b/recruitment/urls.py index 55b72eb..cb16bf2 100644 --- a/recruitment/urls.py +++ b/recruitment/urls.py @@ -5,7 +5,7 @@ from . import views_integration from . import views_source urlpatterns = [ - path('', views_frontend.dashboard_view, name='dashboard'), + path('dashboard/', views_frontend.dashboard_view, name='dashboard'), # Job URLs (using JobPosting model) path('jobs/', views_frontend.JobListView.as_view(), name='job_list'), diff --git a/recruitment/views_frontend.py b/recruitment/views_frontend.py index 537fde7..0f4b9c0 100644 --- a/recruitment/views_frontend.py +++ b/recruitment/views_frontend.py @@ -466,7 +466,7 @@ def dashboard_view(request): print(lst) time_to_hire_query = hired_candidates.annotate( time_diff=ExpressionWrapper( - F('join_date') - F('created_at__date'), + F('hired_date') - F('created_at__date'), output_field=fields.DurationField() ) ).aggregate(avg_time_to_hire=Avg('time_diff')) diff --git a/templates/recruitment/candidate_detail.html b/templates/recruitment/candidate_detail.html index c0de7fb..8ed3ff4 100644 --- a/templates/recruitment/candidate_detail.html +++ b/templates/recruitment/candidate_detail.html @@ -665,7 +665,16 @@
-
{% trans "Time to Hire: " %}{{candidate.time_to_hire|default:100}} days
+
{% trans "Time to Hire:" %} + + {% with days=candidate.time_to_hire_days %} + {% if days > 0 %} + {{ days }} day{{ days|pluralize }} + {% else %} + N/A + {% endif %} + {% endwith %} +