diff options
Diffstat (limited to 'core/views/caves.py')
-rw-r--r-- | core/views/caves.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/views/caves.py b/core/views/caves.py index ba73537..e3b114d 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -241,7 +241,7 @@ def rendercave(request, cave, slug, cave_id=''): ''' #print(" ! rendercave:'{}' slug:'{}' cave_id:'{}'".format(cave, slug, cave_id)) - if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated(): + if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated: return render(request, 'nonpublic.html', {'instance': cave, 'cavepage': True, 'cave_id': cave_id}) else: svxstem = Path(cave.survex_file).parent / Path(cave.survex_file).stem @@ -295,28 +295,28 @@ def cave(request, cave_id='', offical_name=''): def caveEntrance(request, slug): cave = Cave.objects.get(caveslug__slug = slug) - if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated(): + if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated: return render(request,'nonpublic.html', {'instance': cave}) else: return render(request,'cave_entrances.html', {'cave': cave}) def caveDescription(request, slug): cave = Cave.objects.get(caveslug__slug = slug) - if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated(): + if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated: return render(request,'nonpublic.html', {'instance': cave}) else: return render(request,'cave_uground_description.html', {'cave': cave}) def caveQMs(request, slug): cave = Cave.objects.get(caveslug__slug = slug) - if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated(): + if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated: return render(request,'nonpublic.html', {'instance': cave}) else: return render(request,'cave_qms.html', {'cave': cave}) def caveLogbook(request, slug): cave = Cave.objects.get(caveslug__slug = slug) - if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated(): + if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated: return render(request,'nonpublic.html', {'instance': cave}) else: return render(request,'cave_logbook.html', {'cave': cave}) @@ -438,7 +438,7 @@ def ent(request, cave_id, ent_letter): def entranceSlug(request, slug): entrance = Entrance.objects.get(entranceslug__slug = slug) - if entrance.non_public and not request.user.is_authenticated(): + if entrance.non_public and not request.user.is_authenticated: return render(request,'nonpublic.html', {'instance': entrance}) else: return render(request,'entranceslug.html', {'entrance': entrance}) @@ -597,7 +597,7 @@ def plot(surveypoint, number, point_type, label, mapcode, draw, img): def prospecting_image(request, name): # We should replace all this with something that exports an overlay for Google Maps and OpenStreetView mainImage = Image.open(os.path.join(settings.SURVEY_SCANS, "location_maps", "pguidemap.jpg")) - if settings.PUBLIC_SITE and not request.user.is_authenticated(): + if settings.PUBLIC_SITE and not request.user.is_authenticated: mainImage = Image.new("RGB", mainImage.size, '#ffffff') m = maps[name] #imgmaps = [] |