`.
+
+ **TASK 2: LinkedIn Post Creation**
+ 1. **Write the Post:** Create an engaging, professional, and concise LinkedIn post (maximum 1300 characters) summarizing the opportunity.
+ 2. **Encourage Action:** The post must have a strong call-to-action (CTA) encouraging applications.
+ 3. **Use Hashtags:** Integrate relevant industry, role, and company hashtags (including any provided in the raw input) naturally at the end of the post.
+
+ **STRICT JSON OUTPUT INSTRUCTIONS:**
+ Output a **single, valid JSON object** with **ONLY** the following three top-level key-value pairs.
+
+ * The values for `html_job_description` and `html_qualifications` MUST be the complete, formatted HTML strings (including all tags).
+ * The value for `linkedin_post` MUST be the complete, final LinkedIn post as a single string not greater than 3000 characters.
+
+ **Output Keys:**
+ 1. `html_job_description`
+ 2. `html_qualifications`
+ 3 `html_job_requirements`
+ 4. `linkedin_post_data`
+
+ **Do not include any other text, explanation, or markdown outside of the final JSON object.**
"""
result = ai_handler(prompt)
-
+ print(f"REsults: {result}")
if result['status'] == 'error':
logger.error(f"AI handler returned error for candidate {job_posting.pk}")
print(f"AI handler returned error for candidate {job_posting.pk}")
@@ -144,9 +174,10 @@ def format_job_description(pk):
data = json.loads(data)
print(data)
- job_posting.description = data.get('job_description')
- job_posting.qualifications = data.get('job_qualifications')
- job_posting.save(update_fields=['description', 'qualifications'])
+ job_posting.description = data.get('html_job_description')
+ job_posting.qualifications = data.get('html_qualifications')
+ job_posting.linkedin_post_formated_data=data.get('linkedin_post_data')
+ job_posting.save(update_fields=['description', 'qualifications','linkedin_post_formated_data'])
def ai_handler(prompt):
@@ -400,6 +431,8 @@ def handle_reume_parsing_and_scoring(pk):
logger.info(f"Successfully scored and saved analysis for candidate {instance.id}")
print(f"Successfully scored and saved analysis for candidate {instance.id}")
+
+
def create_interview_and_meeting(
candidate_id,
job_id,
diff --git a/recruitment/utils.py b/recruitment/utils.py
index 4b24c1a..af759df 100644
--- a/recruitment/utils.py
+++ b/recruitment/utils.py
@@ -612,4 +612,8 @@ def update_meeting(instance, updated_data):
return {"status": "success", "message": "Zoom meeting updated successfully."}
logger.warning(f"Failed to update Zoom meeting {instance.meeting_id}. Error: {result.get('message', 'Unknown error')}")
- return {"status": "error", "message": result.get("message", "Zoom meeting update failed.")}
\ No newline at end of file
+ return {"status": "error", "message": result.get("message", "Zoom meeting update failed.")}
+
+
+
+
diff --git a/recruitment/views.py b/recruitment/views.py
index 9d535fa..28c99da 100644
--- a/recruitment/views.py
+++ b/recruitment/views.py
@@ -357,6 +357,15 @@ def job_detail(request, slug):
status_form = JobPostingStatusForm(request.POST, instance=job)
if status_form.is_valid():
+ job_status=status_form.cleaned_data['status']
+ form_template=job.form_template
+ if job_status=='ACTIVE':
+ form_template.is_active=True
+ form_template.save(update_fields=['is_active'])
+ else:
+ form_template.is_active=False
+ form_template.save(update_fields=['is_active'])
+
status_form.save()
# Add a success message
diff --git a/templates/jobs/job_detail.html b/templates/jobs/job_detail.html
index 25b27f2..952af61 100644
--- a/templates/jobs/job_detail.html
+++ b/templates/jobs/job_detail.html
@@ -347,9 +347,14 @@
{% trans "Create New Form Template" %}
{% else %}
+ {% if job.form_template.is_active %}
{% trans "View Form Template" %}
+ {% else %}
+
{% trans "This job status is not active, the form will appear once the job is made active"%}
+ {% endif %}
+
{% endif %}