Skip to content

Commit

Permalink
fix: deprecated dashboard fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramveeraghanta committed Jan 13, 2025
1 parent b5493a3 commit c779fc0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions apiserver/plane/app/views/dashboard/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,17 +707,17 @@ def get(self, request, slug, dashboard_id=None):

updated_dashboard_widgets = []
for widget_key in widgets_to_fetch:
widget = DeprecatedWidget.objects.filter(key=widget_key).values_list(
"id", flat=True
)
widget = DeprecatedWidget.objects.filter(
key=widget_key
).values_list("id", flat=True)
if widget:
updated_dashboard_widgets.append(
DashboardWidget(
DeprecatedDashboardWidget(
widget_id=widget, dashboard_id=dashboard.id
)
)

DashboardWidget.objects.bulk_create(
DeprecatedDashboardWidget.objects.bulk_create(
updated_dashboard_widgets, batch_size=100
)

Expand All @@ -733,7 +733,7 @@ def get(self, request, slug, dashboard_id=None):
)
.annotate(
dashboard_filters=Subquery(
DashboardWidget.objects.filter(
DeprecatedDashboardWidget.objects.filter(
widget_id=OuterRef("pk"),
dashboard_id=dashboard.id,
filters__isnull=False,
Expand Down Expand Up @@ -792,7 +792,7 @@ def get(self, request, slug, dashboard_id=None):

class WidgetsEndpoint(BaseAPIView):
def patch(self, request, dashboard_id, widget_id):
dashboard_widget = DashboardWidget.objects.filter(
dashboard_widget = DeprecatedDashboardWidget.objects.filter(
widget_id=widget_id, dashboard_id=dashboard_id
).first()
dashboard_widget.is_visible = request.data.get(
Expand Down

0 comments on commit c779fc0

Please sign in to comment.