Fix double registration

This commit is contained in:
Dorian Zedler 2021-08-18 19:11:31 +02:00
parent db944fc3c3
commit a7fa0e665d
Signed by: dozedler
GPG key ID: 989DE36109AFA354

View file

@ -33,7 +33,7 @@ class MlmAccess:
def _handleActorPairRequest(self, id): def _handleActorPairRequest(self, id):
print(f"Pair request for type actor with ID {id}") print(f"Pair request for type actor with ID {id}")
if not self.db.userExists(id): if not self.db.userExists(f"actor-{id}"):
password = ''.join(random.choices(string.ascii_uppercase + string.digits, k=10)) password = ''.join(random.choices(string.ascii_uppercase + string.digits, k=10))
self.db.addUser(f"actor-{id}", password, [f"mlmAccess/actor/{id}/status"], [f"mlmAccess/actor/{id}/action"]) self.db.addUser(f"actor-{id}", password, [f"mlmAccess/actor/{id}/status"], [f"mlmAccess/actor/{id}/action"])