2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-01-20 01:42:30 +00:00

Allow the viewing of noinfo caves on non public website without login

This commit is contained in:
Martin Green 2011-08-08 08:51:12 +01:00
parent da3efb97ce
commit c039183137

View File

@ -30,39 +30,39 @@ def caveindex(request):
def cave(request, cave_id='', offical_name=''):
cave=getCave(cave_id)
if cave.non_public and not request.user.is_authenticated():
if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated():
return render_with_context(request,'nonpublic.html', {'instance': cave, 'cavepage': True})
else:
return render_with_context(request,'cave.html', {'cave': cave, 'cavepage': True})
def caveEntrance(request, slug):
cave = Cave.objects.get(slug = slug)
if cave.non_public and not request.user.is_authenticated():
if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated():
return render_with_context(request,'nonpublic.html', {'instance': cave})
else:
return render_with_context(request,'cave_entrances.html', {'cave': cave})
def caveDescription(request, slug):
cave = Cave.objects.get(slug = slug)
if cave.non_public and not request.user.is_authenticated():
if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated():
return render_with_context(request,'nonpublic.html', {'instance': cave})
else:
return render_with_context(request,'cave_uground_description.html', {'cave': cave})
def caveQMs(request, slug):
cave = Cave.objects.get(slug = slug)
if cave.non_public and not request.user.is_authenticated():
if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated():
return render_with_context(request,'nonpublic.html', {'instance': cave})
else:
return render_with_context(request,'cave_qms.html', {'cave': cave})
def caveLogbook(request, slug):
cave = Cave.objects.get(slug = slug)
if cave.non_public and not request.user.is_authenticated():
if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated():
return render_with_context(request,'nonpublic.html', {'instance': cave})
else:
return render_with_context(request,'cave_logbook.html', {'cave': cave})
def caveSlug(request, slug):
cave = Cave.objects.get(slug = slug)
if cave.non_public and not request.user.is_authenticated():
if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated():
return render_with_context(request,'nonpublic.html', {'instance': cave})
else:
return render_with_context(request,'cave.html', {'cave': cave})