From: Radek Czajka Date: Tue, 6 Aug 2019 12:10:20 +0000 (+0200) Subject: Migrate from raven to sentry-sdk. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/356ce56229b7439ae6f35f8f80e480bdfa8bff56?ds=inline Migrate from raven to sentry-sdk. --- diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 2911a9a8f..5081a1d99 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -58,7 +58,7 @@ deprecated httplib2 -raven +sentry-sdk==0.10.2 mailchimp3 diff --git a/src/funding/forms.py b/src/funding/forms.py index 915e2aa09..c3661d5e9 100644 --- a/src/funding/forms.py +++ b/src/funding/forms.py @@ -58,5 +58,5 @@ adres e-mail zostanie wykorzystany także w celu przesyłania newslettera Wolnyc amount=self.cleaned_data['amount'], language_code=get_language(), ) - funding.perks = funding.offer.get_perks(funding.amount) + funding.perks.set(funding.offer.get_perks(funding.amount)) return funding diff --git a/src/wolnelektury/settings/__init__.py b/src/wolnelektury/settings/__init__.py index 4cab2b136..8e0815b3f 100644 --- a/src/wolnelektury/settings/__init__.py +++ b/src/wolnelektury/settings/__init__.py @@ -2,6 +2,9 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # # Django settings for wolnelektury project. +import sentry_sdk +from sentry_sdk.integrations.django import DjangoIntegration + from .apps import * from .basic import * from .auth import * @@ -18,3 +21,14 @@ try: from wolnelektury.localsettings import * except ImportError: pass + + +try: + SENTRY_DSN +except NameError: + pass +else: + sentry_sdk.init( + dsn=SENTRY_DSN, + integrations=[DjangoIntegration()] + ) diff --git a/src/wolnelektury/settings/apps.py b/src/wolnelektury/settings/apps.py index 76ffa6f45..241b4b791 100644 --- a/src/wolnelektury/settings/apps.py +++ b/src/wolnelektury/settings/apps.py @@ -58,7 +58,6 @@ INSTALLED_APPS_CONTRIB = [ 'getpaid', 'getpaid.backends.payu', 'django_extensions', - 'raven.contrib.django.raven_compat', 'club.apps.ClubConfig', 'debug_toolbar', diff --git a/src/wolnelektury/settings/contrib.py b/src/wolnelektury/settings/contrib.py index 528688b56..66c876270 100644 --- a/src/wolnelektury/settings/contrib.py +++ b/src/wolnelektury/settings/contrib.py @@ -1,8 +1,6 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from django.utils.translation import ugettext_lazy as _ - HONEYPOT_FIELD_NAME = 'miut' PAGINATION_INVALID_PAGE_RAISES_404 = True THUMBNAIL_QUALITY = 95