- commit
- 31de15c4d146268cbf7ebedcb4e5e774a50a3aac
- parent
- a022db2cddd7c80b5173392669692620de558067
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-02-28 19:14
Revert "add ical feed" This reverts commit 91ff5fbc0ba2385b41d188a7acc8f5aa15db0f32.
Diffstat
| M | Makefile | 2 | +- |
| M | rebelstuff/admin.py | 1 | - |
| D | rebelstuff/feeds.py | 43 | ------------------------------------------- |
| M | rebelstuff/urls.py | 2 | -- |
4 files changed, 1 insertions, 47 deletions
diff --git a/Makefile b/Makefile
@@ -1,7 +1,7 @@ 1 1 .PHONY: all 2 2 all: 3 3 if [ ! -d .venv ]; then python3 -m venv .venv; fi4 -1 .venv/bin/pip install django django-ical-1 4 .venv/bin/pip install django 5 5 .venv/bin/python manage.py migrate 6 6 .venv/bin/python manage.py compilemessages -l de 7 7 .venv/bin/python manage.py loaddata sample_groups sample_data
diff --git a/rebelstuff/admin.py b/rebelstuff/admin.py
@@ -10,7 +10,6 @@ from . import models 10 10 class Site(admin.AdminSite): 11 11 site_header = 'RebelStuff' 12 12 site_title = 'RebelStuff'13 -1 site_url = '/ical/?token=' + settings.FEED_TOKEN14 13 index_title = _('Home') 15 14 16 15
diff --git a/rebelstuff/feeds.py b/rebelstuff/feeds.py
@@ -1,43 +0,0 @@1 -1 from django.urls import reverse2 -13 -1 from django_ical.views import ICalFeed4 -15 -1 from .models import Booking6 -17 -1 # not perfect, but still helpful8 -1 STATUS_MAP = {9 -1 'waiting': 'TENTATIVE',10 -1 'delivered': 'CONFIRMED',11 -1 'returned': 'CANCELLED',12 -1 }13 -114 -1 class BookingFeed(ICalFeed):15 -1 def items(self):16 -1 return Booking.objects.all()17 -118 -1 def item_title(self, booking):19 -1 return booking.name20 -121 -1 def item_link(self, booking):22 -1 return reverse('admin:rebelstuff_booking_change', args=[booking.id])23 -124 -1 def item_start_datetime(self, booking):25 -1 return booking.start26 -127 -1 def item_end_datetime(self, booking):28 -1 return booking.end29 -130 -1 def item_status(self, booking):31 -1 return STATUS_MAP[booking.status]32 -133 -1 def item_description(self, booking):34 -1 description = booking.get_status_display() + '\n'35 -136 -1 if booking.contact:37 -1 description += '\n' + booking.contact + '\n'38 -139 -1 for item in booking.bookingitem_set.all():40 -1 item_str = '%s: %i' % (item.stuff.name, item.amount)41 -1 description += '\n' + item_str42 -143 -1 return description
diff --git a/rebelstuff/urls.py b/rebelstuff/urls.py
@@ -1,9 +1,7 @@ 1 1 from django.urls import path 2 2 3 3 from .admin import site4 -1 from .feeds import BookingFeed5 4 6 5 urlpatterns = [ 7 6 path('', site.urls),8 -1 path('ical/', BookingFeed())9 7 ]