mirror of
https://github.com/clearml/clearml-server
synced 2025-03-03 10:43:10 +00:00
Fix pre-populate logic to avoid overriding existing users
This commit is contained in:
parent
d4edeaaf1b
commit
39ceb5ac5c
@ -298,8 +298,9 @@ class PrePopulate:
|
||||
if company_id is None:
|
||||
company_id = ""
|
||||
|
||||
# Always use a public user for pre-populated data
|
||||
cls.user_cls(id=user_id, name=user_name, company="").save()
|
||||
existing_user = cls.user_cls.objects(id=user_id).only("id").first()
|
||||
if not existing_user:
|
||||
cls.user_cls(id=user_id, name=user_name, company=company_id).save()
|
||||
|
||||
cls._import(zfile, company_id, user_id, metadata)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user