🗃️(teams) remove slug field

After some reflexion, the use of a slug field raises to many
problems without being really needed.

One problem is the slug is made from the group name, but we
don't have unicity on this, so a user might be blocked without
any clue.

We also want to allow group names to be reused (which is already
allowed except for the automatic slug).

The unique ID that will be shared with Service Providers will be
the PK/UUID.
This commit is contained in:
Quentin BEY
2024-10-23 17:21:03 +02:00
committed by BEY Quentin
parent 79e92214ab
commit 72abe04c72
11 changed files with 25 additions and 158 deletions

View File

@@ -172,7 +172,6 @@ class TeamSerializer(serializers.ModelSerializer):
"""Serialize teams."""
abilities = serializers.SerializerMethodField(read_only=True)
slug = serializers.SerializerMethodField()
class Meta:
model = models.Team
@@ -181,7 +180,6 @@ class TeamSerializer(serializers.ModelSerializer):
"name",
"accesses",
"abilities",
"slug",
"created_at",
"updated_at",
]
@@ -189,7 +187,6 @@ class TeamSerializer(serializers.ModelSerializer):
"id",
"accesses",
"abilities",
"slug",
"created_at",
"updated_at",
]
@@ -209,10 +206,6 @@ class TeamSerializer(serializers.ModelSerializer):
return team.get_abilities(request.user)
return {}
def get_slug(self, instance):
"""Return slug from the team's name."""
return instance.get_slug()
class InvitationSerializer(serializers.ModelSerializer):
"""Serialize invitations."""