Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
rollback the static committees hack :( it causes the web app to crash…
Browse files Browse the repository at this point in the history
… (possibly due to cache)
  • Loading branch information
OriHoch committed Nov 29, 2017
1 parent 538bcdc commit cf32fdc
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions committees/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,42 @@
CommitteeListView, CommitteeDetailView, TopicListView, TopicsMoreView,
TopicDetailView, delete_topic, delete_topic_rating, meeting_list_by_date,
edit_topic, CommitteeMMMDocuments, UnpublishedProtocolslistView, FutureMeetingslistView)
from django.http.response import HttpResponse, Http404
import os
# from django.http.response import HttpResponse, Http404
# import os


meetings_list = MeetingsListView.as_view()
unpublished_protocols_list = UnpublishedProtocolslistView.as_view()
future_meetings_list = FutureMeetingslistView.as_view()


def static_committees_index_view(request):
filepath = "/oknesset_web/committees/dist/committees/index.html"
if os.path.exists(filepath):
with open(filepath) as f:
return HttpResponse(f.read())
else:
return CommitteeListView.as_view()(request)


def static_committees_page_view(request, *args):
filepath = "/oknesset_web/committees/dist/{}".format(request.path)
if os.path.exists(filepath):
with open(filepath) as f:
return HttpResponse(f.read())
else:
return Http404()
# def static_committees_index_view(request):
# filepath = "/oknesset_web/committees/dist/committees/index.html"
# if os.path.exists(filepath):
# with open(filepath) as f:
# return HttpResponse(f.read())
# else:
# return CommitteeListView.as_view()(request)
#
#
# def static_committees_page_view(request, *args):
# filepath = "/oknesset_web/committees/dist/{}".format(request.path)
# if os.path.exists(filepath):
# with open(filepath) as f:
# return HttpResponse(f.read())
# else:
# return Http404()


committeesurlpatterns = patterns('',
# static committee pages
url(r'^committee/$', static_committees_index_view, name='committee-list'),
url(r'^committees/knesset-(\d+).html', static_committees_page_view),
url(r'^committees/(\d+).html', static_committees_page_view),
url(r'^meetings/(\d+)/(\d+)/(\d+).html', static_committees_page_view),
url(r'^committees/index.html', static_committees_page_view),
# url(r'^committee/$', static_committees_index_view, name='committee-list'),
# url(r'^committees/knesset-(\d+).html', static_committees_page_view),
# url(r'^committees/(\d+).html', static_committees_page_view),
# url(r'^meetings/(\d+)/(\d+)/(\d+).html', static_committees_page_view),
# url(r'^committees/index.html', static_committees_page_view),

url(r'^committee/$', CommitteeListView.as_view(), name='committee-list'),
url(r'^committee/more-topics/$', TopicsMoreView.as_view(),
name='committee-topics-more'),
url(r'^committee/(?P<pk>\d+)/$', CommitteeDetailView.as_view(),
Expand Down

0 comments on commit cf32fdc

Please sign in to comment.