fix: model ordering (#521)
* fix: model ordering * fix: my pages and create by others pages
This commit is contained in:
parent
c6ba93da72
commit
5152deb2d0
8 changed files with 51 additions and 10 deletions
|
|
@ -91,7 +91,7 @@ class ProjectViewSet(BaseViewSet):
|
|||
projects = (
|
||||
self.get_queryset()
|
||||
.annotate(is_favorite=Exists(subquery))
|
||||
.order_by("-is_favorite")
|
||||
.order_by("name", "-is_favorite")
|
||||
)
|
||||
return Response(ProjectDetailSerializer(projects, many=True).data)
|
||||
except Exception as e:
|
||||
|
|
@ -101,7 +101,6 @@ class ProjectViewSet(BaseViewSet):
|
|||
status=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
|
||||
|
||||
def create(self, request, slug):
|
||||
try:
|
||||
workspace = Workspace.objects.get(slug=slug)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue