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

update:URL paths and change DataResponseModel.identifier field #44

Merged
merged 1 commit into from
Nov 14, 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
6 changes: 3 additions & 3 deletions orp/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def search(self, request, *args, **kwargs):


class RebuildCacheViewSet(viewsets.ViewSet):
@action(detail=False, methods=["post"], url_path="rebuildcache")
@action(detail=False, methods=["post"], url_path="rebuild")
def rebuild_cache(self, request, *args, **kwargs):
from orp_search.legislation import Legislation
from orp_search.public_gateway import PublicGateway
Expand Down Expand Up @@ -126,10 +126,10 @@ def rebuild_cache(self, request, *args, **kwargs):
# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r"v1", DataResponseViewSet, basename="search")
router.register(r"v1", RebuildCacheViewSet, basename="rebuildcache")
router.register(r"v1", RebuildCacheViewSet, basename="rebuild")

urlpatterns = [
path("", include(router.urls)),
path("api/", include(router.urls)),
path("", orp_search_views.search_react, name="search_react"),
path("nojs/", orp_search_views.search_django, name="search_django"),
# If we choose to have a start page with green button, this is it:
Expand Down
2 changes: 1 addition & 1 deletion orp/orp_search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class DataResponseModel(models.Model):
title = models.TextField(null=True, blank=True)
identifier = models.URLField(unique=True)
identifier = models.TextField(null=True, blank=True)
publisher = models.TextField(null=True, blank=True)
language = models.TextField(null=True, blank=True)
format = models.TextField(null=True, blank=True)
Expand Down