Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
I am trying to do what I thought was a simple user sign in. Here is my route, models, and the error it is spitting out when I'm trying to log in as the user.
Here is the models
And lastly here is the error I get spit out
Thanks for the reporting! We need to fix it.
In order to fix the error you need to replace the line
to the following code:
user_ip = User_IP.get(user=user, ip_address=ip_address) if user_ip is None: user_ip = User_IP(user=user, ip_address=ip_address, date_used=datetime.now()) user.ips.add(user_ip) else: user_ip.date_used = datetime.now()
This version of code assumes that you want to keep only the last
Probably we need to add