26 lines
897 B
Python
26 lines
897 B
Python
from main import db
|
|
from sqlalchemy import Sequence
|
|
from flask_login import UserMixin
|
|
from sqlalchemy.exc import SQLAlchemyError
|
|
from status import st, Status
|
|
|
|
# pylint: disable=no-member
|
|
|
|
################################################################################
|
|
# Class describing Person in the database and DB via sqlalchemy
|
|
# id is unique id in DB
|
|
# dn is ldap distinguised name
|
|
# any entry in this DB is effectively a record you already authed successfully
|
|
# so acts as a session marker. If you fail ldap auth, you dont get a row here
|
|
################################################################################
|
|
class PAUser(UserMixin,db.Model):
|
|
__tablename__ = "pa_user"
|
|
id = db.Column(db.Integer, db.Sequence('pa_user_id_seq'), primary_key=True)
|
|
dn = db.Column(db.String)
|
|
|
|
def __repr__(self):
|
|
return self.dn
|
|
|
|
def get_id(self):
|
|
return self.dn
|