Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polio-1708 delete deprecated endpoints #1828

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading