[FIX] RECRUITMENT: Fixed candidate login page displaying on document tab
This commit is contained in:
@@ -155,6 +155,12 @@ def candidate_login_required(view_func):
|
||||
|
||||
if request.user.has_perm("recruitment.view_candidate"):
|
||||
return view_func(request, *args, **kwargs)
|
||||
if request.user:
|
||||
if (
|
||||
request.user.employee_get.stage_set.exists()
|
||||
or request.user.employee_get.recruitment_set.exists()
|
||||
):
|
||||
return view_func(request, *args, **kwargs)
|
||||
|
||||
if "candidate_id" in request.session:
|
||||
return view_func(request, *args, **kwargs)
|
||||
|
||||
@@ -1708,7 +1708,6 @@ def candidate_conversion(request, cand_id, **kwargs):
|
||||
emp_document_list.append(emp_document)
|
||||
|
||||
if emp_document_list:
|
||||
print(emp_document_list)
|
||||
Document.objects.bulk_create(emp_document_list)
|
||||
else:
|
||||
messages.info(request, "A employee with this mail already exists")
|
||||
@@ -3364,10 +3363,6 @@ def file_upload(request, id):
|
||||
|
||||
Returns: return document_form template
|
||||
"""
|
||||
candidate_id = request.session.get("candidate_id")
|
||||
if not candidate_id:
|
||||
return redirect("candidate-login")
|
||||
|
||||
document_item = CandidateDocument.objects.get(id=id)
|
||||
form = CandidateDocumentUpdateForm(instance=document_item)
|
||||
if request.method == "POST":
|
||||
@@ -3398,10 +3393,6 @@ def view_file(request, id):
|
||||
|
||||
Returns: return view_file template
|
||||
"""
|
||||
candidate_id = request.session.get("candidate_id")
|
||||
if not candidate_id:
|
||||
return redirect("candidate-login")
|
||||
|
||||
document_obj = CandidateDocument.objects.filter(id=id).first()
|
||||
context = {
|
||||
"document": document_obj,
|
||||
@@ -3492,10 +3483,6 @@ def candidate_add_notes(request, cand_id):
|
||||
This method renders template component to add candidate remark
|
||||
"""
|
||||
|
||||
candidate_id = request.session.get("candidate_id")
|
||||
if not candidate_id:
|
||||
return redirect("candidate-login")
|
||||
|
||||
candidate = Candidate.objects.get(id=cand_id)
|
||||
updated_by = request.user.employee_get if request.user.is_authenticated else None
|
||||
label = (
|
||||
|
||||
Reference in New Issue
Block a user