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

Add new chain "No URL to redirect to. Either provide a url or define a get_absolute_url method on the Model." #2

Open
ManInWeb3 opened this issue Aug 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ManInWeb3
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Add a new chain
│ 2023-08-28 20:54:57,753 django.request ERROR    Internal Server Error: /chain/add/                                                                                                                                     │
│ Traceback (most recent call last):                                                                                                                                                                                     │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 125, in get_success_url                                                                                                            │
│     url = self.object.get_absolute_url()                                                                                                                                                                               │
│           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                 │
│ AttributeError: 'Chain' object has no attribute 'get_absolute_url'                                                                                                                                                     │
│                                                                                                                                                                                                                        │
│ During handling of the above exception, another exception occurred:                                                                                                                                                    │
│                                                                                                                                                                                                                        │
│ Traceback (most recent call last):                                                                                                                                                                                     │
│   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner                                                                                                                  │
│     response = get_response(request)                                                                                                                                                                                   │
│                ^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                   │
│   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response                                                                                                              │
│     response = wrapped_callback(request, *callback_args, **callback_kwargs)                                                                                                                                            │
│                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                            │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view                                                                                                                       │
│     return self.dispatch(request, *args, **kwargs)                                                                                                                                                                     │
│            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                     │
│   File "/usr/local/lib/python3.11/site-packages/django/utils/decorators.py", line 46, in _wrapper                                                                                                                      │
│     return bound_method(*args, **kwargs)                                                                                                                                                                               │
│            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                               │
│   File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view                                                                                                          │
│     return view_func(request, *args, **kwargs)                                                                                                                                                                         │
│            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                         │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch                                                                                                                   │
│     return handler(request, *args, **kwargs)                                                                                                                                                                           │
│            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                           │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 184, in post                                                                                                                       │
│     return super().post(request, *args, **kwargs)                                                                                                                                                                      │
│            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                      │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 153, in post                                                                                                                       │
│     return self.form_valid(form)                                                                                                                                                                                       │
│            ^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                       │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 136, in form_valid                                                                                                                 │
│     return super().form_valid(form)                                                                                                                                                                                    │
│            ^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                    │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 65, in form_valid                                                                                                                  │
│     return HttpResponseRedirect(self.get_success_url())                                                                                                                                                                │
│                                 ^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                 │
│   File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 127, in get_success_url                                                                                                            │
│     raise ImproperlyConfigured(                                                                                                                                                                                        │
│ django.core.exceptions.ImproperlyConfigured: No URL to redirect to.  Either provide a url or define a get_absolute_url method on the Model.  
@ManInWeb3 ManInWeb3 added the bug Something isn't working label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant