You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if you are looking for feedback, but FYI testing this with my Django setup and getting Cannot force an update in save() with no primary key. on update_fields = frozenset({'last_login'}).
False False frozenset({'last_login'})
Internal Server Error: /django/login/
Traceback (most recent call last):
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/contrib/admin/sites.py", line 440, in login
return LoginView.as_view(**defaults)(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/views/decorators/debug.py", line 143, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 188, in _view_wrapper
result = _process_exception(request, e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 186, in _view_wrapper
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/contrib/auth/views.py", line 88, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/views/generic/edit.py", line 151, in post
return self.form_valid(form)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/contrib/auth/views.py", line 107, in form_valid
auth_login(self.request, form.get_user())
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/contrib/auth/__init__.py", line 152, in login
user_logged_in.send(sender=user.__class__, request=request, user=user)
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/dispatch/dispatcher.py", line 189, in send
response = receiver(signal=self, sender=sender, **named)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/contrib/auth/models.py", line 23, in update_last_login
user.save(update_fields=["last_login"])
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/contrib/auth/base_user.py", line 78, in save
super().save(*args, **kwargs)
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/db/models/base.py", line 822, in save
self.save_base(
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/db/models/base.py", line 909, in save_base
updated = self._save_table(
^^^^^^^^^^^^^^^^^
File "/Users/alexclark/Developer/test/test-django-mongodb/.venv/lib/python3.12/site-packages/django/db/models/base.py", line 1016, in _save_table
raise ValueError("Cannot force an update in save() with no primary key.")
ValueError: Cannot force an update in save() with no primary key.
[12/Jun/2024 17:47:59] "POST /django/login/?next=/django/ HTTP/1.1" 500 286725
Not Found: /favicon.ico
[12/Jun/2024 17:47:59] "GET /favicon.ico HTTP/1.1" 404 15933
In the event this is not a known issue I'm interested in looking into it, if anyone would like to provide some feedback or direction. 😄 Thank you
The text was updated successfully, but these errors were encountered:
Hey all,
Not sure if you are looking for feedback, but FYI testing this with my Django setup and getting
Cannot force an update in save() with no primary key.
onupdate_fields
=frozenset({'last_login'})
.In the event this is not a known issue I'm interested in looking into it, if anyone would like to provide some feedback or direction. 😄 Thank you
The text was updated successfully, but these errors were encountered: