Skip to content

Commit

Permalink
fix: delete deprecated endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
quang-le authored Dec 3, 2024
2 parents 2145a17 + d9c4e0d commit 6afd7f2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 373 deletions.
13 changes: 3 additions & 10 deletions plugins/polio/api/dashboards/forma.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ class FormAStocksViewSetV2(viewsets.ViewSet):
for display in PowerBI
"""

# Still used by a dashboard
@action(detail=False)
def scopes(self, request):
country = request.GET.get("country", "")
Expand All @@ -308,6 +309,7 @@ def scopes(self, request):

return HttpResponse(r, content_type="application/json")

# deprecated
@method_decorator(cache_page(60 * 60 * 1)) # cache result for one hour
def list(self, request):
df = fetch_and_match_forma_data()
Expand All @@ -320,6 +322,7 @@ def list(self, request):
r = df.to_json(orient="table")
return HttpResponse(r, content_type="application/json")

# deprecated
@method_decorator(cache_page(60 * 60 * 1)) # cache result for one hour
def retrieve(self, request, pk):
df = fetch_and_match_forma_data(country_id=pk)
Expand All @@ -331,13 +334,3 @@ def retrieve(self, request, pk):
else:
r = df.to_json(orient="table")
return HttpResponse(r, content_type="application/json")


class FormAStocksViewSet(viewsets.ViewSet):
"""
Endpoint used to transform Vaccine Stocks data from existing ODK forms stored in ONA.
sample config: [{"url": "https://afro.who.int/api/v1/data/yyy", "login": "d", "country": "hyrule", "password": "zeldarules", "country_id": 2115781}]
"""

def list(self, request):
return handle_ona_request_with_key(request, "forma")
312 changes: 0 additions & 312 deletions plugins/polio/api/lqas_im/im_stats.py

This file was deleted.

4 changes: 0 additions & 4 deletions plugins/polio/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from iaso.api.config import ConfigViewSet
from plugins.polio.api.chronogram.views import ChronogramViewSet, ChronogramTaskViewSet, ChronogramTemplateTaskViewSet
from plugins.polio.api.country_user_groups import CountryUsersGroupViewSet
from plugins.polio.api.dashboards.forma import FormAStocksViewSet
from plugins.polio.api.dashboards.forma import FormAStocksViewSetV2
from plugins.polio.api.dashboards.launch_powerbi import LaunchPowerBIRefreshViewSet
from plugins.polio.api.dashboards.preparedness_dashboard import PreparednessDashboardViewSet
Expand All @@ -25,7 +24,6 @@
)
from plugins.polio.api.dashboards.vaccine_stocks import VaccineStocksViewSet
from plugins.polio.api.lqas_im.countries_with_lqas_im import CountriesWithLqasIMConfigViewSet
from plugins.polio.api.lqas_im.im_stats import IMStatsViewSet
from plugins.polio.api.lqas_im.lqas_im_country import LQASIMCountryViewset
from plugins.polio.api.lqas_im.lqasim_global_map import LQASIMGlobalMapViewSet
from plugins.polio.api.lqas_im.lqasim_zoom_in_map import LQASIMZoominMapBackgroundViewSet, LQASIMZoominMapViewSet
Expand Down Expand Up @@ -66,9 +64,7 @@
router.register(r"polio/workflow", WorkflowViewSet, basename="BudgetWorkflow")
router.register(r"polio/campaignsgroup", CampaignGroupViewSet, basename="campaigngroup")
router.register(r"polio/preparedness_dashboard", PreparednessDashboardViewSet, basename="preparedness_dashboard")
router.register(r"polio/imstats", IMStatsViewSet, basename="imstats")
router.register(r"polio/vaccines", VaccineStocksViewSet, basename="vaccines")
router.register(r"polio/forma", FormAStocksViewSet, basename="forma")
router.register(r"polio/v2/forma", FormAStocksViewSetV2, basename="forma")
router.register(r"polio/countryusersgroup", CountryUsersGroupViewSet, basename="countryusersgroup")
router.register(r"polio/orgunitspercampaign", OrgUnitsPerCampaignViewset, basename="orgunitspercampaign")
Expand Down
Loading

0 comments on commit 6afd7f2

Please sign in to comment.