Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable privacy policy url #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions bitpoll/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pytz import all_timezones

from bitpoll.registration.forms import RegisterForm
from bitpoll.settings import IMPRINT_URL
from bitpoll.settings import IMPRINT_URL, PRIVACY_URL
from django.core import signing
from django.conf import settings

Expand Down Expand Up @@ -161,7 +161,10 @@ def problems(request):


def privacy(request):
return TemplateResponse(request, 'base/privacy.html')
if PRIVACY_URL:
return redirect(PRIVACY_URL)
else:
return TemplateResponse(request, 'base/privacy.html')


@login_required
Expand Down
4 changes: 4 additions & 0 deletions bitpoll/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'HOME_URL_NAME',
'IMPRINT_TEXT',
'IMPRINT_URL',
'PRIVACY_URL',
'TIME_ZONE',
'REGISTER_ENABLED',
'MAIL_SIGNATURE',
Expand Down Expand Up @@ -326,6 +327,9 @@
<p>Text goes here</p>
"""

## if the PRIVACY_URL is not empty use it as an link to the privacy policy, else use bitpoll/base/templates/base/privacy.html
PRIVACY_URL = ""

LOCALE_PATHS = (os.path.join(ROOT_DIR, 'locale'), )

LANGUAGES = (
Expand Down
3 changes: 3 additions & 0 deletions bitpoll/settings_local.sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
#<p>Text goes here</p>
#"""

## if the PRIVACY_URL is not empty use it as an link to the privacy policy, else use bitpoll/base/templates/base/privacy.html
#PRIVACY_URL = ""

#LOCALE_PATHS = (os.path.join(ROOT_DIR, 'locale'), )
#LANGUAGES = (
# ('de', 'Deutsch'),
Expand Down