X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/05654e3a2f44de8dd901651b0a74e6f4eda980be..4e361d55331351f56077e5f9999ecb4ee7e93819:/src/suggest/forms.py?ds=inline diff --git a/src/suggest/forms.py b/src/suggest/forms.py index cfcaab566..90d3b9896 100644 --- a/src/suggest/forms.py +++ b/src/suggest/forms.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # @@ -6,8 +5,8 @@ from django import forms from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.core.mail import send_mail, mail_managers -from django.core.urlresolvers import reverse from django.core.validators import validate_email +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext @@ -31,7 +30,7 @@ adres e-mail zostanie wykorzystany także w celu przesyłania newslettera Wolnyc description = self.cleaned_data['description'] suggestion = Suggestion(contact=contact, description=description, ip=request.META['REMOTE_ADDR']) - if request.user.is_authenticated(): + if request.user.is_authenticated: suggestion.user = request.user suggestion.save() @@ -45,7 +44,7 @@ Kontakt: %(contact)s %(description)s''' % { 'site': Site.objects.get_current().domain, 'url': reverse('admin:suggest_suggestion_change', args=[suggestion.id]), - 'user': str(request.user) if request.user.is_authenticated() else '', + 'user': str(request.user) if request.user.is_authenticated else '', 'contact': contact, 'description': description, }, fail_silently=True) @@ -90,7 +89,7 @@ class PublishingSuggestForm(NewsletterForm): suggestion = PublishingSuggestion( contact=contact, books=books, audiobooks=audiobooks, ip=request.META['REMOTE_ADDR']) - if request.user.is_authenticated(): + if request.user.is_authenticated: suggestion.user = request.user suggestion.save() @@ -108,7 +107,7 @@ class PublishingSuggestForm(NewsletterForm): Audiobooki: %(audiobooks)s''' % { 'url': request.build_absolute_uri(reverse('admin:suggest_suggestion_change', args=[suggestion.id])), - 'user': str(request.user) if request.user.is_authenticated() else '', + 'user': str(request.user) if request.user.is_authenticated else '', 'contact': contact, 'books': books, 'audiobooks': audiobooks,