| 489 | |
| 490 | |
| 491 | class UserLoginHistory(Base): |
| 492 | __tablename__ = 'user_login_history' |
| 493 | |
| 494 | """ |
| 495 | |
| 496 | """ |
| 497 | |
| 498 | # TODO may want to get full name here |
| 499 | |
| 500 | id = Column(Integer, primary_key = True) |
| 501 | |
| 502 | created_time = Column(DateTime, default = datetime.datetime.utcnow) |
| 503 | |
| 504 | success = Column(Boolean) |
| 505 | otp_success = Column(Boolean) |
| 506 | |
| 507 | remote_address = Column(String()) |
| 508 | |
| 509 | user_id = Column(Integer, ForeignKey('userbase.id')) |
| 510 | user = relationship("User") |
| 511 | |
| 512 | |
| 513 | def new_login_history(session, success, otp_success, remote_address, user_id): |