diff options
-rw-r--r-- | core/forms.py | 6 | ||||
-rw-r--r-- | core/views_caves.py | 2 | ||||
-rw-r--r-- | localsettingspotatohut.py | 8 |
3 files changed, 9 insertions, 7 deletions
diff --git a/core/forms.py b/core/forms.py index 75814ee..9d02066 100644 --- a/core/forms.py +++ b/core/forms.py @@ -29,6 +29,8 @@ class CaveForm(ModelForm): self._errors["official_name"] = self.error_class(["This field is required when there is a kataster number."]) if self.cleaned_data.get("area") == []: 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 class VersionControlCommentForm(forms.Form): @@ -53,6 +55,10 @@ class EntranceForm(ModelForm): class Meta: model = Entrance 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 diff --git a/core/views_caves.py b/core/views_caves.py index 511deb0..e3df0b3 100644 --- a/core/views_caves.py +++ b/core/views_caves.py @@ -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(): return render_with_context(request,'nonpublic.html', {'instance': cave, 'cavepage': True}) 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): cave = Cave.objects.get(caveslug__slug = slug) diff --git a/localsettingspotatohut.py b/localsettingspotatohut.py index e5e91d6..a9c39d5 100644 --- a/localsettingspotatohut.py +++ b/localsettingspotatohut.py @@ -9,16 +9,12 @@ DATABASES = { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'troggle', # Or path to database file if using sqlite3. 'USER': 'expo', # Not used with sqlite3. - 'PASSWORD': 'wibble', # Not used with sqlite3. + 'PASSWORD': 'notarealpassword', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } -EXPOUSER = 'expo' -EXPOUSERPASS = 'realpasshere' -EXPOUSER_EMAIL = 'wookey@wookware.org' - REPOS_ROOT_PATH = '/home/expo/' sys.path.append(REPOS_ROOT_PATH) sys.path.append(REPOS_ROOT_PATH + 'troggle') @@ -48,7 +44,7 @@ MEDIA_URL = '/' + DIR_ROOT + 'site_media/' MEDIA_ROOT = REPOS_ROOT_PATH + '/troggle/media/' MEDIA_ADMIN_DIR = '/usr/lib/python2.7/site-packages/django/contrib/admin/media/' -JSLIB_URL = URL_ROOT + 'javascript/' +JSLIB_PATH = '/usr/share/javascript/' TINY_MCE_MEDIA_ROOT = '/usr/share/tinymce/www/' TINY_MCE_MEDIA_URL = URL_ROOT + DIR_ROOT + 'tinymce_media/' |