[UPDT] PAYROLL: Updated payroll mail send function by changing mail server

This commit is contained in:
Horilla
2024-03-28 14:30:54 +05:30
parent 2c29b1ce96
commit cf8f810241

View File

@@ -946,7 +946,9 @@ def send_slip(request):
Send payslip method
"""
email_backend = ConfiguredEmailBackend()
if not email_backend and not len(email_backend.dynamic_username_with_display_name):
if not getattr(
email_backend, "dynamic_username_with_display_name", None
) or not len(email_backend.dynamic_username_with_display_name):
messages.error(request, "Email server is not configured")
return redirect(view_payslip)
payslip_ids = request.GET.getlist("id")