[UPDT] Code formatting
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if perms.employee.delete_employee %}
|
||||
|
||||
|
||||
{% with emp.contract_set.first as contract %}
|
||||
{% if contract.contract_status == 'active' %}
|
||||
<li class="oh-dropdown__item">
|
||||
@@ -108,7 +108,7 @@
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="oh-dropdown__item">
|
||||
<form action="{% url 'employee-delete' emp.id %}?view=card" method="post"
|
||||
<form action="{% url 'employee-delete' emp.id %}?view=card" method="post"
|
||||
onsubmit="return confirm('{% trans "The employee contract in" %} {{ contract.get_contract_status_display }} {% trans "state will also be deleted, Do you want to continue ?" %}')">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="oh-dropdown__link oh-dropdown__link--danger">{% trans "Delete" %}</button>
|
||||
|
||||
@@ -271,9 +271,9 @@
|
||||
|
||||
{% with emp.contract_set.first as contract %}
|
||||
{% if contract.contract_status == 'active' %}
|
||||
<form
|
||||
action="{% url 'employee-delete' emp.id %}?view=list"
|
||||
onsubmit="return confirm('{% trans "Are you sure want to delete this employee?" %}')"
|
||||
<form
|
||||
action="{% url 'employee-delete' emp.id %}?view=list"
|
||||
onsubmit="return confirm('{% trans "Are you sure want to delete this employee?" %}')"
|
||||
method="post" style = "width:100%"
|
||||
> {% csrf_token %}
|
||||
<button
|
||||
@@ -285,8 +285,8 @@
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form
|
||||
action="{% url 'employee-delete' emp.id %}?view=list"
|
||||
<form
|
||||
action="{% url 'employee-delete' emp.id %}?view=list"
|
||||
onsubmit="return confirm('{% trans "The employee contract in" %} {{ contract.get_contract_status_display }} {% trans "state will also be deleted, Do you want to continue ?" %}')"
|
||||
method="post" style = "width:100%"
|
||||
> {% csrf_token %}
|
||||
|
||||
@@ -1897,7 +1897,7 @@ def employee_delete(request, obj_id):
|
||||
employee = Employee.objects.get(id=obj_id)
|
||||
if Contract.objects.get(employee_id=obj_id) is not None:
|
||||
contract = Contract.objects.get(employee_id=obj_id)
|
||||
if contract.contract_status != 'active':
|
||||
if contract.contract_status != "active":
|
||||
contract.delete()
|
||||
user = employee.employee_user_id
|
||||
user.delete()
|
||||
@@ -2681,7 +2681,9 @@ def work_info_import(request):
|
||||
employee_work_info.shift_id = shift_obj
|
||||
employee_work_info.location = location
|
||||
employee_work_info.date_joining = (
|
||||
date_joining if not pd.isnull(date_joining) else datetime.today()
|
||||
date_joining
|
||||
if not pd.isnull(date_joining)
|
||||
else datetime.today()
|
||||
)
|
||||
employee_work_info.contract_end_date = (
|
||||
contract_end_date if not pd.isnull(contract_end_date) else None
|
||||
|
||||
@@ -506,4 +506,3 @@ form label {
|
||||
left: 0;
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user