Refactoring tagging

This commit is contained in:
2020-09-12 11:24:16 +02:00
parent 317437fedc
commit 7f73035b02
5 changed files with 11 additions and 15 deletions

View File

@@ -33,11 +33,11 @@ class PlaceDetailView(IsAuthenticated, View):
'place': place,
'place_list': [ place ],
'place_map_center': [ place.latitude, place.longitude ],
'all_tags': Tag.objects.all(),
'tagging_config': {
'submit_url': reverse_lazy('place_tag_submit', kwargs={'place_id': place.id}),
'all_tags': Tag.objects.all(),
'submit_form': TagSubmitForm(),
'tagged_item': place,
'submit_url_name': 'place_tag_submit',
'delete_url_name': 'place_tag_delete'
}
}

View File

@@ -54,8 +54,8 @@ class PhotoAlbumDeleteView(PlaceAssetDeleteView):
permission_denied_messsage = 'You do not have permissions to alter this photo album'
class PlaceTagSubmitView(IsAuthenticated, View):
def post(self, request, place_id, *args, **kwargs):
place = Place.objects.get(pk=place_id)
def post(self, request, tagged_id, *args, **kwargs):
place = Place.objects.get(pk=tagged_id)
form = TagSubmitForm(request.POST)
if form.is_valid():
tag_list_raw = form.cleaned_data['tag_list']