def METHOD_NAME(self, instance, validated_data):
    identifier = validated_data.get("identifier", "").strip().upper()
    # If identifier is not passed update the project and return
    if identifier == "":
        project = super().METHOD_NAME(instance, validated_data)
        return project
    # If no Project Identifier is found create it
    project_identifier = ProjectIdentifier.objects.filter(
        name=identifier, workspace_id=instance.workspace_id
    ).first()
    if project_identifier is None:
        project = super().METHOD_NAME(instance, validated_data)
        project_identifier = ProjectIdentifier.objects.filter(
            project=project
        ).first()
        if project_identifier is not None:
            project_identifier.name = identifier
            project_identifier.save()
        return project
    # If found check if the project_id to be updated and identifier project id is same
    if project_identifier.project_id == instance.id:
        # If same pass update
        project = super().METHOD_NAME(instance, validated_data)
        return project
    # If not same fail update
    raise serializers.ValidationError(detail="Project Identifier is already taken")