-
Notifications
You must be signed in to change notification settings - Fork 241
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
AssertionError #133
Comments
Thanks for the reporting! We need to fix it. In order to fix the error you need to replace the line user.ips.create(ip_address=ip_address, date_used=datetime.now()) 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 |
Thanks, worked. |
# New features * All arguments of db.bind() can be specified as keyword arguments. Previously Pony required the first positional argument which specified the database provider. Now you can pass all the database parameters using the dict: db.bind(**db_params). See https://docs.ponyorm.com/api_reference.html#Database.bind * The `optimistic` attribute option is added https://docs.ponyorm.com/api_reference.html#cmdoption-arg-optimistic # Bugfixes * Fixes #219: when a database driver raises an error, sometimes this error was masked by the 'RollbackException: InterfaceError: connection already closed' exception. This happened because on error, Pony tried to rollback transaction, but the connection to the database was already closed and it masked the initial error. Now Pony displays the original error which helps to understand the cause of the problem. * Fixes #276: Memory leak * Fixes the __all__ declaration. Previously IDEs, such as PyCharm, could not understand what is going to be imported by 'from pony.orm import *'. Now it works fine. * Fixes #232: negate check for numeric expressions now checks if value is zero or NULL * Fixes #238, fixes #133: raise TransactionIntegrityError exception instead of AssertionError if obj.collection.create(**kwargs) creates a duplicate object * Fixes #221: issue with unicode json path keys * Fixes bug when discriminator column is used as a part of a primary key * Handle situation when SQLite blob column contains non-binary value
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
The text was updated successfully, but these errors were encountered: