merge serve changes

HGerver canges Enter commit message.  Lines beginning with 'HG:' are removed.
This commit is contained in:
expo 2016-06-09 04:16:46 +01:00
commit 4320e76298
3 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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)

View File

@ -15,10 +15,6 @@ DATABASES = {
} }
} }
EXPOUSER = 'expo'
EXPOUSERPASS = 'realpasshere'
EXPOUSER_EMAIL = 'wookey@wookware.org'
REPOS_ROOT_PATH = '/home/expo/' REPOS_ROOT_PATH = '/home/expo/'
sys.path.append(REPOS_ROOT_PATH) sys.path.append(REPOS_ROOT_PATH)
sys.path.append(REPOS_ROOT_PATH + 'troggle') sys.path.append(REPOS_ROOT_PATH + 'troggle')
@ -33,8 +29,8 @@ CAVERN = 'cavern'
THREEDTOPOS = '3dtopos' THREEDTOPOS = '3dtopos'
EXPOWEB = REPOS_ROOT_PATH + 'expoweb/' EXPOWEB = REPOS_ROOT_PATH + 'expoweb/'
SURVEYS = REPOS_ROOT_PATH SURVEYS = REPOS_ROOT_PATH
SURVEY_SCANS = REPOS_ROOT_PATH + 'expofiles/' SURVEY_SCANS = REPOS_ROOT_PATH + 'expoimages/'
FILES = REPOS_ROOT_PATH + 'expofiles' FILES = REPOS_ROOT_PATH + 'expoimages'
PYTHON_PATH = '/home/expo/troggle/' PYTHON_PATH = '/home/expo/troggle/'
@ -49,7 +45,6 @@ MEDIA_ROOT = REPOS_ROOT_PATH + '/troggle/media/'
MEDIA_ADMIN_DIR = '/usr/lib/python2.7/site-packages/django/contrib/admin/media/' MEDIA_ADMIN_DIR = '/usr/lib/python2.7/site-packages/django/contrib/admin/media/'
JSLIB_PATH = '/usr/share/javascript/' JSLIB_PATH = '/usr/share/javascript/'
JSLIB_URL = URL_ROOT + 'javascript/'
TINY_MCE_MEDIA_ROOT = '/usr/share/tinymce/www/' TINY_MCE_MEDIA_ROOT = '/usr/share/tinymce/www/'
TINY_MCE_MEDIA_URL = URL_ROOT + DIR_ROOT + 'tinymce_media/' TINY_MCE_MEDIA_URL = URL_ROOT + DIR_ROOT + 'tinymce_media/'