diff --git a/api/funkwhale_api/manage/serializers.py b/api/funkwhale_api/manage/serializers.py index add9364e8..a9b19939d 100644 --- a/api/funkwhale_api/manage/serializers.py +++ b/api/funkwhale_api/manage/serializers.py @@ -44,12 +44,14 @@ class ManageUserSimpleSerializer(serializers.ModelSerializer): class ManageUserSerializer(serializers.ModelSerializer): permissions = PermissionsSerializer(source="*") upload_quota = serializers.IntegerField(allow_null=True) + actor = serializers.SerializerMethodField() class Meta: model = users_models.User fields = ( "id", "username", + "actor", "email", "name", "is_active", @@ -82,6 +84,10 @@ class ManageUserSerializer(serializers.ModelSerializer): ) return instance + def get_actor(self, obj): + if obj.actor: + return ManageBaseActorSerializer(obj.actor).data + class ManageInvitationSerializer(serializers.ModelSerializer): users = ManageUserSimpleSerializer(many=True, required=False) diff --git a/api/funkwhale_api/manage/views.py b/api/funkwhale_api/manage/views.py index 83981116c..6e4edc888 100644 --- a/api/funkwhale_api/manage/views.py +++ b/api/funkwhale_api/manage/views.py @@ -291,7 +291,7 @@ class ManageUserViewSet( mixins.UpdateModelMixin, viewsets.GenericViewSet, ): - queryset = users_models.User.objects.all().order_by("-id") + queryset = users_models.User.objects.all().select_related("actor").order_by("-id") serializer_class = serializers.ManageUserSerializer filterset_class = filters.ManageUserFilterSet required_scope = "instance:users" diff --git a/changes/changelog.d/869.bugfix b/changes/changelog.d/869.bugfix new file mode 100644 index 000000000..7d56f3175 --- /dev/null +++ b/changes/changelog.d/869.bugfix @@ -0,0 +1 @@ +Fixed broken user admin for users with non-digit or letters in their username (#869) diff --git a/front/src/components/manage/users/UsersTable.vue b/front/src/components/manage/users/UsersTable.vue index ee1d3110b..a508f5be9 100644 --- a/front/src/components/manage/users/UsersTable.vue +++ b/front/src/components/manage/users/UsersTable.vue @@ -45,7 +45,8 @@