Re: Update profile on login

2018-11-12 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Nov 09, 2018 at 08:32:28AM -0800, pastrufazio wrote: > Il giorno venerdì 9 novembre 2018 11:37:23 UTC+1, Michal Petrucha ha > scritto: > > Found it. :) The error lies in the filter() call: > > > > Thank you very much. I fixed it using >

Re: Update profile on login

2018-11-09 Thread pastrufazio
Il giorno venerdì 9 novembre 2018 11:37:23 UTC+1, Michal Petrucha ha scritto: Found it. :) The error lies in the filter() call: > > Thank you very much. I fixed it using @receiver(user_logged_in, sender=User) def user_logged_in_callback(sender, user, request, **kwargs): Profile.objects.fi

Re: Update profile on login

2018-11-09 Thread Michal Petrucha
-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 i

Re: Update profile on login

2018-11-09 Thread pastrufazio
Il giorno venerdì 9 novembre 2018 10:29:06 UTC+1, Michal Petrucha ha scritto: > > > Hi, > > Could you please post the full stack trace rather than just the final > error message? That would make it easier to help you. > > Cheers, > Michal > Sure, thanks! Environment: Request Method: PO

Re: Update profile on login

2018-11-09 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Thu, Nov 08, 2018 at 09:17:30AM -0800, pastrufazio wrote: > > Hi all, > > I'm trying to update the field "date_activation" the first time a user log > in. > > This is the error I get when i try to run the code below > > *TypeError at /admin/l

Update profile on login

2018-11-08 Thread pastrufazio
Hi all, I'm trying to update the field "date_activation" the first time a user log in. This is the error I get when i try to run the code below *TypeError at /admin/login/ int() argument must be a string, a bytes-like object or a number, not 'ModelBase'* Any help would be really appreciated!