#58 Voting UI is bugged when no vote was submitted
This commit is contained in:
@@ -19,7 +19,8 @@ from django.urls import reverse_lazy, reverse
|
||||
from lostplaces.models import (
|
||||
Place,
|
||||
PlaceImage,
|
||||
PlaceVoting
|
||||
PlaceVoting,
|
||||
PLACE_LEVELS
|
||||
)
|
||||
|
||||
from lostplaces.views.base_views import (
|
||||
@@ -71,7 +72,10 @@ class PlaceDetailView(IsAuthenticatedMixin, IsEligibleToSeePlaceMixin, View):
|
||||
'submit_url': reverse('place_tag_submit', kwargs={'tagged_id': place.id}),
|
||||
'delete_url_name': 'place_tag_delete'
|
||||
},
|
||||
'placevoting': PlaceVoting.objects.filter(place=place, submitted_by=explorer).first()
|
||||
'placevoting': {
|
||||
'users_vote': PlaceVoting.objects.filter(place=place, submitted_by=explorer).first(),
|
||||
'all_choices': reversed(PLACE_LEVELS)
|
||||
}
|
||||
}
|
||||
return render(request, 'place/place_detail.html', context)
|
||||
|
||||
|
Reference in New Issue
Block a user