horilla-opensource / horilla

Horilla is a free and open source HR software.
https://www.horilla.com/
GNU Lesser General Public License v2.1
186 stars 130 forks source link

AttributeError at /attendance/late-come-early-out-view/ #267

Closed asis658 closed 3 weeks ago

asis658 commented 2 months ago

Bug Report

Description

Whenever I click on "late come early out" tab it throws this error.

Steps to Reproduce

From the horilla dashboard click on "attendance/late come early out"

Expected Behavior

some setting page for late come early out setup.

Actual Behavior

It's throwing attributeerror message every time

Screenshots

[If applicable, provide screenshots illustrating the issue.]

Environment

Additional Information

Here's the piece of error message page. AttributeError 'NoneType' object has no attribute 'is_enable' /opt/hr_project/horilla/horilla/decorators.py, line 306, in _function horilla.decorators.wrapped_view /opt/hr_project/myenv/bin/python3 3.10.12 ['/opt/hr_project/horilla', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/opt/hr_project/myenv/lib/python3.10/site-packages'] Mon, 29 Jul 2024 11:22:43 +0530 I have tried 2-3 times with the fresh installation to be sure it's not due to some installation error. But the error persists in every installation.

horilla-opensource commented 2 months ago

Hi @asis658 , The issue is solved and the code will be published soon with a major update in the code base. Will let you know once its been pushed to the master branch. Sorry for the delay.

With Regards, Team Horilla

duanehughes commented 1 month ago

@horilla-opensource - has this code been pushed to master branch yet? This error still occurs on latest HEAD of master branch.

horilla-opensource commented 1 month ago

Hi @duanehughes , The issue was already fixed for the user after the commit. He has confirmed it on our skype conversation. Can you please share with the us the details of the error you are facing?

With Regards, Team Horilla

duanehughes commented 1 month ago

Yes, certainly. We have just performed a fresh install against master branch. We were exploring the interface for the first time. The steps performed are exactly as described in the first comment.

Here is the error we receive when clicking on "late come early out" link:

Environment:

Request Method: GET
Request URL: http://myserver.example.com/attendance/late-come-early-out-view/

Django Version: 4.2.11
Python Version: 3.10.14
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',
 'horilla_audit',
 'horilla_widgets',
 'horilla_crumbs',
 'horilla_documents',
 'haystack',
 'horilla_views',
 'horilla_automations',
 'auditlog',
 'biometric',
 'helpdesk',
 'offboarding']
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']

Traceback (most recent call last):
  File "/app/horilla/decorators.py", line 234, in wrapped_view
    func = view_func(request, *args, **kwargs)
  File "/app/horilla/decorators.py", line 309, in _function
    if object.is_enable:

During handling of the above exception ('NoneType' object has no attribute 'is_enable'), another exception occurred:
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/app/horilla/decorators.py", line 249, in wrapped_view
    return view_func(request, *args, **kwargs)
  File "/app/horilla/decorators.py", line 309, in _function
    if object.is_enable:

Exception Type: AttributeError at /attendance/late-come-early-out-view/
Exception Value: 'NoneType' object has no attribute 'is_enable'
horilla-opensource commented 1 month ago

Hi @duanehughes , The fix has been updated to the master code. Please pull the latest code and try again. Apologize for the inconvenience caused.

With Regards, Team Horilla

duanehughes commented 1 month ago

Thank you!

horilla-opensource commented 3 weeks ago

Hi @asis658 , We are closing this issue due to inactivity. It seems that there hasn't been any recent activity or discussion, and we believe it may have been resolved or is no longer relevant. If you feel this issue is still important and should be addressed, please feel free to reopen it or create a new issue with updated details.

With Regards, Team Horilla