diff --git a/recruitment/__pycache__/forms.cpython-312.pyc b/recruitment/__pycache__/forms.cpython-312.pyc index cfa60ce..4c46da2 100644 Binary files a/recruitment/__pycache__/forms.cpython-312.pyc and b/recruitment/__pycache__/forms.cpython-312.pyc differ diff --git a/recruitment/__pycache__/urls.cpython-312.pyc b/recruitment/__pycache__/urls.cpython-312.pyc index fe68685..5e3fefc 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 f6c5db4..2e15eb7 100644 Binary files a/recruitment/__pycache__/views.cpython-312.pyc and b/recruitment/__pycache__/views.cpython-312.pyc differ diff --git a/recruitment/forms.py b/recruitment/forms.py index 6f4e28a..d9989d1 100644 --- a/recruitment/forms.py +++ b/recruitment/forms.py @@ -629,7 +629,11 @@ class JobPostingStatusForm(forms.ModelForm): widgets = { 'status': forms.Select(attrs={'class': 'form-select'}), } - +class LinkedPostContentForm(forms.ModelForm): + class Meta: + model = JobPosting + fields = ['linkedin_post_formated_data'] + class FormTemplateIsActiveForm(forms.ModelForm): class Meta: model = FormTemplate diff --git a/recruitment/tasks.py b/recruitment/tasks.py index e5a454a..a6d47cb 100644 --- a/recruitment/tasks.py +++ b/recruitment/tasks.py @@ -509,7 +509,7 @@ def handle_zoom_webhook_event(payload): # We rely on the unique 'id' that maps to your ZoomMeeting.meeting_id field. meeting_id_zoom = str(object_data.get('id')) print(meeting_id_zoom) - if not meeting_id_zoom:job_posting.application_url}" + if not meeting_id_zoom: logger.warning(f"Webhook received without a valid Meeting ID: {event_type}") return False diff --git a/recruitment/urls.py b/recruitment/urls.py index d3e418f..1c63b71 100644 --- a/recruitment/urls.py +++ b/recruitment/urls.py @@ -65,7 +65,8 @@ urlpatterns = [ path('forms/builder//', views.form_builder, name='form_builder'), path('forms/', views.form_templates_list, name='form_templates_list'), path('forms/create-template/', views.create_form_template, name='create_form_template'), - + + path('jobs//edit_linkedin_post_content/',views.edit_linkedin_post_content,name='edit_linkedin_post_content'), path('jobs//candidate_screening_view/', views.candidate_screening_view, name='candidate_screening_view'), path('jobs//candidate_exam_view/', views.candidate_exam_view, name='candidate_exam_view'), path('jobs//candidate_interview_view/', views.candidate_interview_view, name='candidate_interview_view'), diff --git a/recruitment/views.py b/recruitment/views.py index 28c99da..c2d9331 100644 --- a/recruitment/views.py +++ b/recruitment/views.py @@ -33,6 +33,7 @@ from .forms import ( StaffUserCreationForm, MeetingCommentForm, ToggleAccountForm, + LinkedPostContentForm ) from easyaudit.models import CRUDEvent, LoginEvent, RequestEvent @@ -343,6 +344,7 @@ def job_detail(request, slug): offer_count = applicants.filter(stage="Offer").count() status_form = JobPostingStatusForm(instance=job) + linkedin_content_form=LinkedPostContentForm(instance=job) try: # If the related object exists, use its instance data image_upload_form = JobPostingImageForm(instance=job.post_images) @@ -471,6 +473,7 @@ def job_detail(request, slug): 'high_potential_ratio': high_potential_ratio, 'avg_t2i_days': avg_t2i_days, 'avg_t_in_exam_days': avg_t_in_exam_days, + 'linkedin_content_form':linkedin_content_form } return render(request, "jobs/job_detail.html", context) @@ -508,6 +511,30 @@ def job_image_upload(request, slug): return redirect('job_detail', slug=job.slug) +@login_required +def edit_linkedin_post_content(request,slug): + + job=get_object_or_404(JobPosting,slug=slug) + linkedin_content_form=LinkedPostContentForm(instance=job) + if request.method=='POST': + linkedin_content_form=LinkedPostContentForm(request.POST,instance=job) + if linkedin_content_form.is_valid(): + linkedin_content_form.save() + messages.success(request,"Linked post content updated successfully!") + return redirect('job_detail',job.slug) + else: + messages.error(request,"Error update the Linkedin Post content") + return redirect('job_detail',job.slug) + + else: + linkedin_content_form=LinkedPostContentForm() + return redirect('job_detail',job.slug) + + + + + + def kaauh_career(request): active_jobs = JobPosting.objects.select_related( 'form_template' diff --git a/templates/jobs/job_detail.html b/templates/jobs/job_detail.html index 952af61..84939f9 100644 --- a/templates/jobs/job_detail.html +++ b/templates/jobs/job_detail.html @@ -356,6 +356,8 @@ {% endif %} {% endif %} + + @@ -404,6 +406,11 @@ {% trans "Error:" %} {{ job.linkedin_post_status }} {% endif %} + {% if job.linkedin_post_formated_data %} + + {% endif %} @@ -499,6 +506,7 @@ {% include "jobs/partials/image_upload.html" %} +{% include "jobs/partials/linkedin_content_form.html"%}