Commit f79b4420 authored by Jean-Baptiste's avatar Jean-Baptiste

update: avoid reverse url collision by using model_prefix

parent 066e5ef7
Pipeline #4189 passed with stage
in 27 seconds
from django.conf.urls import url
from .views import JobOffersViewset, JobOffersCurrentViewset, \
from .views import JobOffersCurrentViewset, \
JobOffersExpiredViewset
urlpatterns = [
url(r'^job-offers/current/', JobOffersCurrentViewset.urls()),
url(r'^job-offers/expired/', JobOffersExpiredViewset.urls()),
# Dirty fix for bad id change to job-offers/self/
url(r'^job-offers/', JobOffersViewset.urls()),
url(r'^job-offers/current/', JobOffersCurrentViewset.urls(model_prefix="joboffer-current")),
url(r'^job-offers/expired/', JobOffersExpiredViewset.urls(model_prefix="joboffer-expired")),
]
......@@ -18,10 +18,3 @@ class JobOffersExpiredViewset(LDPViewSet):
return super().get_queryset() \
.filter(closingDate__lte=datetime.now())
# Dirty fix for bad id change to job-offers/self/
class JobOffersViewset(LDPViewSet):
model = JobOffer
def get_queryset(self):
return super().get_queryset()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment