mirror of
https://github.com/makeplane/plane.git
synced 2026-01-06 13:51:21 -06:00
migrate: refine migration to update existing non-service API tokens by excluding bot users from workspace removal
This commit is contained in:
@@ -32,9 +32,9 @@ def migrate_existing_api_tokens(apps, schema_editor):
|
||||
APIToken = apps.get_model('db', 'APIToken')
|
||||
|
||||
# Update all the existing non-service api tokens to not have a workspace
|
||||
APIToken.objects.filter(is_service=False).update(
|
||||
APIToken.objects.filter(is_service=False, user__is_bot=False).update(
|
||||
workspace_id=None,
|
||||
user__is_bot=False
|
||||
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user