-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Found it. :) The error lies in the filter() call:
> @receiver(user_logged_in, sender=User)
> def user_logged_in_callback(sender, user, request, **kwargs):
> Profile.objects.filter(user=User).update(date_activation=datetime.now)
You're passing in the User class as the argument, rather than the
instance.
By the way, I suggest that you use django.utils.timezone.now() instead
of datetime.now; it's usually a good idea to use timezone-aware
timestamps. And side note, you need to call the function;
QuerySet.update doesn't accept callables.
Cheers,
Michal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCgAGBQJb5WMVAAoJEHA7T/IPM/klwgkQAJpdDsTNeCFKnmcDpmXPs+S7
vQy+aEyaV3VkfgCpH92n/3Csvad5Fw4cloSef+4DIR1897Hj2x7ga8HA7chcPdJ5
g/mZQNti54ILJMOnWAISD5jPlikec9eibfs06PPSdJnz5O3fcN1hPAy5klWNyEDd
nL4u9IXqWeo8RtkPjKxLzm/im7QWLXYxPGtHnvQHpqHNQGvH0txfLHjUtCUvFV75
ZLPXDO1WUuVsX5T+JEJaLYy9L9TivE5QPwszBdG5pCVd3wJEgLgnkiWxLCbIKRNH
2+M+WQpQfJ2QgA9mOrxWXQaUQB/j8BNyJ1QqW/9F81TDzFjX4i4RIUy6myXrGTnY
l0yDE0O6tD3creuGYGmh9hJXXi/BWq39mkB/dCBSuHzA0qMc65g1UIS8plVCchMK
9djJwpwMo4uuWaQImUrN5d8lSlNDo7Hk5S4lGcGOyiAbuZ9qoSLDSRB0WFVouStW
3XU/9TU5u5FB/ay/oaZGE41V5y4NLpLNFQBtTowX6DQ2sj4d8H9xdFrms6mnwaJ3
+TPSalWERJ/oHGWp9or1kM+4/fYhku47ByteLcLWJM5sG+nF8omt+te+h5l/rVS9
COW8eFfAoMA2pf1ulIlpymEr8XsDJMAnJDF/5lo8GbDoo0g0IpIn0IzxB8KNqzAp
AUb68j4udCCpBCkgOZPB
=80IM
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20181109103605.GC8269%40koniiiik.org.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment