From dba6d2b2a204addf3b714ef0ec12bbc44bfbfd5c Mon Sep 17 00:00:00 2001
From: Julian Rother <julianr@fsmpi.rwth-aachen.de>
Date: Mon, 5 Apr 2021 17:54:14 +0200
Subject: [PATCH] Fixed startup warning by duplicating model code

---
 uffd/role/models.py | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/uffd/role/models.py b/uffd/role/models.py
index ade38702..0b2502fa 100644
--- a/uffd/role/models.py
+++ b/uffd/role/models.py
@@ -7,21 +7,31 @@ from ldapalchemy.dbutils import DBRelationship
 from uffd.database import db
 from uffd.user.models import User, Group
 
-class LdapMapping:
-	id = Column(Integer(), primary_key=True, autoincrement=True)
-	dn = Column(String(128))
+class RoleGroup(db.Model):
+	__tablename__ = 'role-group'
 	__table_args__ = (
 		db.UniqueConstraint('dn', 'role_id'),
 	)
+
+	id = Column(Integer(), primary_key=True, autoincrement=True)
+	dn = Column(String(128))
+
 	@declared_attr
 	def role_id(self):
 		return Column(ForeignKey('role.id'))
 
-class RoleGroup(LdapMapping, db.Model):
-	__tablename__ = 'role-group'
-
-class RoleUser(LdapMapping, db.Model):
+class RoleUser(db.Model):
 	__tablename__ = 'role-user'
+	__table_args__ = (
+		db.UniqueConstraint('dn', 'role_id'),
+	)
+
+	id = Column(Integer(), primary_key=True, autoincrement=True)
+	dn = Column(String(128))
+
+	@declared_attr
+	def role_id(self):
+		return Column(ForeignKey('role.id'))
 
 # pylint: disable=E1101
 role_inclusion = db.Table('role-inclusion',
-- 
GitLab