#64 Testing drafts in differents views

This commit is contained in:
Leonhard Strohmidel
2022-09-25 18:03:22 +02:00
parent df67bcf639
commit bc0ace7bf3
3 changed files with 66 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.utils.translation import gettext as _
from django.utils import timezone
from django.utils.translation import gettext as _
from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse_lazy, reverse
@@ -59,6 +60,12 @@ class PlaceDetailView(IsAuthenticatedMixin, IsEligibleToSeePlaceMixin, View):
place.calculate_place_level()
explorer = request.user.explorer
if place.mode == 'draft':
messages.info(
self.request,
_('This place is still in draft mode and only visible to the submitter and superusers')
)
context = {
'place': place,
'mapping_config': {