from .ldap_app import PpLdapAppError, PpLdapApplication
-__version__ = '0.4.1'
+__version__ = '0.4.2'
LOG = logging.getLogger(__name__)
if self.verbose > 1:
LOG.debug("User data to insert:\n{}".format(pp(self.users_to_add)))
+ sql = textwrap.dedent('''\
+ INSERT INTO public.user (uid, name, email, active, admin, developer)
+ VALUES (%(uid)s, %(name)s, %(email)s, %(active)s, %(admin)s, %(developer)s)
+ ''').strip()
+ if self.verbose > 1:
+ LOG.debug("Insert SQL:\n{}".format(sql))
+
+ with self.db_connection.cursor() as db_cursor:
+
+ for db_user in self.users_to_add:
+
+ if self.verbose > 1:
+ show_sql = db_cursor.mogrify(sql, db_user)
+ LOG.debug("Executing:\n{}".format(show_sql))
+ if not self.simulate:
+ db_cursor.execute(sql, db_user)
+
# -------------------------------------------------------------------------
def change_db_users(self):