core: make groups field for user optional (#5702)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
6900ffffd8
commit
8029a13be1
|
@ -45,7 +45,7 @@ def check_blueprint_v1_file(BlueprintInstance: type, path: Path):
|
||||||
enabled=True,
|
enabled=True,
|
||||||
managed_models=[],
|
managed_models=[],
|
||||||
last_applied_hash="",
|
last_applied_hash="",
|
||||||
metadata=metadata,
|
metadata=metadata or {},
|
||||||
)
|
)
|
||||||
instance.save()
|
instance.save()
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ class UserSerializer(ModelSerializer):
|
||||||
avatar = CharField(read_only=True)
|
avatar = CharField(read_only=True)
|
||||||
attributes = JSONField(validators=[is_dict], required=False)
|
attributes = JSONField(validators=[is_dict], required=False)
|
||||||
groups = PrimaryKeyRelatedField(
|
groups = PrimaryKeyRelatedField(
|
||||||
allow_empty=True, many=True, source="ak_groups", queryset=Group.objects.all()
|
allow_empty=True, many=True, source="ak_groups", queryset=Group.objects.all(), default=list
|
||||||
)
|
)
|
||||||
groups_obj = ListSerializer(child=UserGroupSerializer(), read_only=True, source="ak_groups")
|
groups_obj = ListSerializer(child=UserGroupSerializer(), read_only=True, source="ak_groups")
|
||||||
uid = CharField(read_only=True)
|
uid = CharField(read_only=True)
|
||||||
|
|
|
@ -3888,8 +3888,7 @@
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"username",
|
"username",
|
||||||
"name",
|
"name"
|
||||||
"groups"
|
|
||||||
],
|
],
|
||||||
"title": "User"
|
"title": "User"
|
||||||
},
|
},
|
||||||
|
@ -4080,8 +4079,7 @@
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"username",
|
"username",
|
||||||
"name",
|
"name"
|
||||||
"groups"
|
|
||||||
],
|
],
|
||||||
"title": "User"
|
"title": "User"
|
||||||
},
|
},
|
||||||
|
@ -4276,8 +4274,7 @@
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"username",
|
"username",
|
||||||
"name",
|
"name"
|
||||||
"groups"
|
|
||||||
],
|
],
|
||||||
"title": "User"
|
"title": "User"
|
||||||
},
|
},
|
||||||
|
@ -6419,8 +6416,7 @@
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"username",
|
"username",
|
||||||
"name",
|
"name"
|
||||||
"groups"
|
|
||||||
],
|
],
|
||||||
"title": "User"
|
"title": "User"
|
||||||
},
|
},
|
||||||
|
@ -7155,8 +7151,7 @@
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"username",
|
"username",
|
||||||
"name",
|
"name"
|
||||||
"groups"
|
|
||||||
],
|
],
|
||||||
"title": "User"
|
"title": "User"
|
||||||
},
|
},
|
||||||
|
|
|
@ -40977,7 +40977,6 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- avatar
|
- avatar
|
||||||
- groups
|
|
||||||
- groups_obj
|
- groups_obj
|
||||||
- is_superuser
|
- is_superuser
|
||||||
- name
|
- name
|
||||||
|
@ -41435,7 +41434,6 @@ components:
|
||||||
type: string
|
type: string
|
||||||
minLength: 1
|
minLength: 1
|
||||||
required:
|
required:
|
||||||
- groups
|
|
||||||
- name
|
- name
|
||||||
- username
|
- username
|
||||||
UserSAMLSourceConnection:
|
UserSAMLSourceConnection:
|
||||||
|
|
Reference in New Issue