Skip to content
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

TypeError error in logs #192

Open
SubrahmanyaG opened this issue May 27, 2020 · 3 comments
Open

TypeError error in logs #192

SubrahmanyaG opened this issue May 27, 2020 · 3 comments

Comments

@SubrahmanyaG
Copy link

When i m accessing the logs i m getting the error
formfield_for_dbfield() missing 1 required positional argument: 'request'

when i debugged the issue it is found out to be the difference in chroniker and django admin

chroniker method

    def formfield_for_dbfield(self, db_field, **kwargs):
        request = kwargs.pop("request", None)

django 2.15.x method

    def formfield_for_dbfield(self, db_field, request, **kwargs):
        """
        Hook for specifying the form Field instance for a given database Field

Can you please suggest me the solution to this? or on which django version this issue woun't be there

@chrisspen
Copy link
Owner

Could you post your entire traceback and the django-chroniker version you're using?

@SubrahmanyaG
Copy link
Author

sure @chrisspen here is the traceback

Internal Server Error: /admin/chroniker/log/2452/change/
Traceback (most recent call last):
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/contrib/admin/options.py", line 604, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/contrib/admin/sites.py", line 223, in inner
    return view(request, *args, **kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/contrib/admin/options.py", line 1651, in change_view
    return self.changeform_view(request, object_id, form_url, extra_context)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/contrib/admin/options.py", line 1532, in changeform_view
    return self._changeform_view(request, object_id, form_url, extra_context)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/contrib/admin/options.py", line 1565, in _changeform_view
    ModelForm = self.get_form(request, obj, change=not add)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/contrib/admin/options.py", line 703, in get_form
    return modelform_factory(self.model, **defaults)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/forms/models.py", line 551, in modelform_factory
    return type(form)(class_name, (form,), form_class_attrs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/forms/models.py", line 256, in __new__
    apply_limit_choices_to=False,
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/django/forms/models.py", line 176, in fields_for_model
    formfield = formfield_callback(f, **kwargs)
  File "/home/hasher/Apps/irident_ai/venv3/lib/python3.6/site-packages/chroniker/admin.py", line 569, in formfield_for_dbfield
    return super(LogAdmin, self).formfield_for_dbfield(db_field, **kwargs)
TypeError: formfield_for_dbfield() missing 1 required positional argument: 'request'
[27/May/2020 16:27:57] "GET /admin/chroniker/log/2452/change/ HTTP/1.1" 500 150514

Django and chroniker versions

Django==2.1.15
django-chroniker==1.0.19

@chrisspen
Copy link
Owner

Looks like your version of django-chroniker is out of date. I can't reproduce the issue on master branch. Could you try upgrading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants