forked from expo/troggle
Commit changes made on expo 2015
This commit is contained in:
parent
eeda1bed73
commit
214d887c57
@ -29,6 +29,8 @@ class CaveForm(ModelForm):
|
|||||||
self._errors["official_name"] = self.error_class(["This field is required when there is a kataster number."])
|
self._errors["official_name"] = self.error_class(["This field is required when there is a kataster number."])
|
||||||
if self.cleaned_data.get("area") == []:
|
if self.cleaned_data.get("area") == []:
|
||||||
self._errors["area"] = self.error_class(["This field is required."])
|
self._errors["area"] = self.error_class(["This field is required."])
|
||||||
|
if self.cleaned_data.get("url").startswith("/"):
|
||||||
|
self._errors["url"] = self.error_class(["This field can not start with a /."])
|
||||||
return self.cleaned_data
|
return self.cleaned_data
|
||||||
|
|
||||||
class VersionControlCommentForm(forms.Form):
|
class VersionControlCommentForm(forms.Form):
|
||||||
@ -53,6 +55,10 @@ class EntranceForm(ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Entrance
|
model = Entrance
|
||||||
exclude = ("cached_primary_slug", "filename",)
|
exclude = ("cached_primary_slug", "filename",)
|
||||||
|
def clean(self):
|
||||||
|
if self.cleaned_data.get("url").startswith("/"):
|
||||||
|
self._errors["url"] = self.error_class(["This field can not start with a /."])
|
||||||
|
return self.cleaned_data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ def cave(request, cave_id='', offical_name=''):
|
|||||||
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_with_context(request,'nonpublic.html', {'instance': cave, 'cavepage': True})
|
return render_with_context(request,'nonpublic.html', {'instance': cave, 'cavepage': True})
|
||||||
else:
|
else:
|
||||||
return render_with_context(request,'cave.html', {'cave': cave, 'cavepage': True})
|
return render_with_context(request,'cave.html', {'settings': settings, 'cave': cave, 'cavepage': True})
|
||||||
|
|
||||||
def caveEntrance(request, slug):
|
def caveEntrance(request, slug):
|
||||||
cave = Cave.objects.get(caveslug__slug = slug)
|
cave = Cave.objects.get(caveslug__slug = slug)
|
||||||
|
Loading…
Reference in New Issue
Block a user