From 9e719a3a9888c0cc2addd1d85287372656f86f26 Mon Sep 17 00:00:00 2001 From: thomasDOTde Date: Fri, 3 Nov 2017 00:00:04 +0100 Subject: [PATCH] fixed merge --- app/models.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/app/models.py b/app/models.py index 7514854..a7f9872 100644 --- a/app/models.py +++ b/app/models.py @@ -288,28 +288,6 @@ class User(db.Model): else: logging.error('Unsupported authentication method') return False - # try to get user's firstname & lastname from LDAP - # this might be changed in the future - self.firstname = result[0][0][1]['givenName'][0] - self.lastname = result[0][0][1]['sn'][0] - self.email = result[0][0][1]['mail'][0] - except Exception: - self.firstname = self.username - self.lastname = '' - - # first register user will be in Administrator role - self.role_id = Role.query.filter_by(name='User').first().id - if User.query.count() == 0: - self.role_id = Role.query.filter_by(name='Administrator').first().id - - self.create_user() - logging.info('Created user "%s" in the DB' % self.username) - - return True - - logging.error('Unsupported authentication method') - return False - def create_user(self): """