--- /usr/share/pyshared/univention/management/console/modules/schoolexam/__init__.py.orig 2021-02-05 08:06:43.793927327 +0100 +++ /usr/share/pyshared/univention/management/console/modules/schoolexam/__init__.py 2021-02-05 08:11:12.178822539 +0100 @@ -686,6 +686,19 @@ if not iuser: continue # not a users/user object logger.info("user has been replicated: %r", idn) + + # Bug #52307: + # Creating two exams quickly in succession leads to the + # second exam mode using the same UIDs as the first. + # -> clear user name cache to force Samba to get the + # new UID from ldap. + logger.info("Clear user name cache...") + cmd = ["/usr/sbin/nscd", "-i", "passwd"] + if subprocess.call(cmd): + logger.error("Clearing user name cache failed: %s", " ".join(cmd)) + else: + logger.info("Clearing user name cache finished successfully.") + # call hook scripts if 0 != subprocess.call( [ @@ -1015,18 +1028,6 @@ # indicate the user has been processed progress.add_steps(percentPerUser) - # Bug #52307: - # Creating two exams quickly in succession leads to the - # second exam mode using the same UIDs as the first. - # -> clear user name cache to force Samba to get the - # new UID from ldap. - logger.info("Clear user name cache...") - cmd = ["/usr/sbin/nscd", "-i", "passwd"] - if subprocess.call(cmd): - logger.error("Clearing user name cache failed: %s", " ".join(cmd)) - else: - logger.info("Clearing user name cache finished successfully.") - logger.info("Finished removing exam accounts.") progress.add_steps(percentPerUser)