-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError at /attendance/work-record-export/ invalid literal for int() with base 10: '' #446
Comments
Hi @rizwanhaiderhero , The error occurred because the month parameter was being processed without checking if it was empty, leading to a ValueError. We’ve updated the source code to handle this scenario more gracefully by ensuring proper validation of the input parameters. If the month or year parameters are missing or empty, a default value is now applied, and any invalid input is handled appropriately. Please pull the latest changes from the repository, and this issue should be resolved. Let us know if you encounter any further problems With Regards, |
get method was used it means whatever month and year is selected |
Thanks for the feedback. Could you provide more details or a short video demonstrating the issue to our mail [email protected] ? This will help us understand the exact scenario and implement a permanent solution. Best regards, |
https://drive.google.com/file/d/1FWcdTZdLEv3Anf4NM61gKmw8D2gWCRo9/view
here is the video showing what is the main issue
and export button is not working as it should be
…On Mon, Jan 6, 2025 at 8:34 AM Horilla ***@***.***> wrote:
Hi ***@***.*** <https://github.com/rizwanhaiderhero>*,
Thanks for the feedback. Could you provide more details or a short video
demonstrating the issue to our mail ***@***.***
***@***.***>* ? This will help us understand the exact scenario
and implement a permanent solution.
Best regards,
*Team Horilla*
—
Reply to this email directly, view it on GitHub
<#446 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEZMIGCS7RJYAMK2Z6FAC532JH2UDAVCNFSM6AAAAABUNCBWN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZSGIYTGMZTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Regards!!
*Rizwan Haider*
Head of Digital Marketing
+92 306 4311528 <+923064311528>
|
Bug Report
I'm facing this error while exporting work records from attendance
Environment:
Request Method: GET
Request URL: http://localhost:8000/attendance/work-record-export/?month=&year=&
Django Version: 4.2.11
Python Version: 3.9.6
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'notifications',
'mathfilters',
'corsheaders',
'simple_history',
'django_filters',
'base',
'employee',
'recruitment',
'leave',
'pms',
'onboarding',
'asset',
'attendance',
'payroll',
'widget_tweaks',
'django_apscheduler',
'accessibility',
'horilla_audit',
'horilla_widgets',
'horilla_crumbs',
'horilla_documents',
'haystack',
'horilla_views',
'horilla_automations',
'auditlog',
'biometric',
'helpdesk',
'offboarding',
'rest_framework',
'rest_framework_simplejwt',
'drf_yasg',
'horilla_api']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'corsheaders.middleware.CorsMiddleware',
'simple_history.middleware.HistoryRequestMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'auditlog.middleware.AuditlogMiddleware',
'base.middleware.CompanyMiddleware',
'horilla.horilla_middlewares.MethodNotAllowedMiddleware',
'horilla.horilla_middlewares.ThreadLocalMiddleware',
'accessibility.middlewares.AccessibilityMiddleware',
'accessibility.middlewares.AccessibilityMiddleware',
'base.middleware.ForcePasswordChangeMiddleware',
'attendance.middleware.AttendanceMiddleware']
Traceback (most recent call last):
File "/Users/rizwanhaider/PycharmProjects/horilla/horilla/decorators.py", line 234, in wrapped_view
func = view_func(request, *args, **kwargs)
File "/Users/rizwanhaider/PycharmProjects/horilla/horilla/decorators.py", line 41, in _function
return function(request, *args, **kwargs)
File "/Users/rizwanhaider/PycharmProjects/horilla/attendance/views/views.py", line 2360, in work_record_export
month = int(request.GET.get("month", date.today().month))
During handling of the above exception (invalid literal for int() with base 10: ''), another exception occurred:
File "/Users/rizwanhaider/PycharmProjects/horilla/horillavenv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/Users/rizwanhaider/PycharmProjects/horilla/horillavenv/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/rizwanhaider/PycharmProjects/horilla/horilla/decorators.py", line 249, in wrapped_view
return view_func(request, *args, **kwargs)
File "/Users/rizwanhaider/PycharmProjects/horilla/horilla/decorators.py", line 41, in _function
return function(request, *args, **kwargs)
File "/Users/rizwanhaider/PycharmProjects/horilla/attendance/views/views.py", line 2360, in work_record_export
month = int(request.GET.get("month", date.today().month))
Exception Type: ValueError at /attendance/work-record-export/
Exception Value: invalid literal for int() with base 10: ''
The text was updated successfully, but these errors were encountered: