# -*- coding: utf-8 -*-
+from allauth.socialaccount.forms import SignupForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
def save(self, commit=True):
super(RegistrationForm, self).save(commit=commit)
NewsletterForm.save(self)
+
+
+class SocialSignupForm(SignupForm, NewsletterForm):
+ data_processing_part2 = u'''\
+Dane są przetwarzane w zakresie niezbędnym do prowadzenia serwisu, a także w celach prowadzenia statystyk, \
+ewaluacji i sprawozdawczości. W przypadku wyrażenia dodatkowej zgody adres e-mail zostanie wykorzystany \
+także w celu przesyłania newslettera Wolnych Lektur.'''
+
+ def save(self, request):
+ super(SocialSignupForm, self).save(request)
+ NewsletterForm.save(self)
--- /dev/null
+{% extends "socialaccount/base.html" %}
+
+{% load i18n %}
+
+{% block head_title %}{% trans "Signup" %}{% endblock %}
+
+{% block content %}
+ <h1>{% trans "Sign Up" %}</h1>
+
+<p>{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to
+{{site_name}}. As a final step, please complete the following form:{% endblocktrans %}</p>
+
+<form class="signup" id="signup_form" method="post" action="{% url 'socialaccount_signup' %}">
+ {% csrf_token %}
+ {{ form.as_p }}
+ {% if redirect_field_value %}
+ <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
+ {% endif %}
+ <p><span class="helptext">{{ form.data_processing }}</span></p>
+ <button type="submit">{% trans "Sign Up" %} »</button>
+</form>
+
+{% endblock %}
url(r'^uzytkownik/signup/$', views.RegisterFormView(), name='register'),
url(r'^uzytkownik/logout/$', views.logout_then_redirect, name='logout'),
url(r'^uzytkownik/zaloguj-utworz/$', views.LoginRegisterFormView(), name='login_register'),
+ url(r'^uzytkownik/social/signup/$', views.SocialSignupView.as_view(), name='socialaccount_signup'),
# Includes.
url(r'^latests_blog_posts.html$', views.latest_blog_posts, name='latest_blog_posts'),
#
from datetime import date, datetime
import feedparser
+from allauth.socialaccount.views import SignupView
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.decorators import login_required
-from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
+from django.contrib.auth.forms import AuthenticationForm
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from ssify import ssi_included
from social.utils import get_or_choose_cite
-from wolnelektury.forms import RegistrationForm
+from wolnelektury.forms import RegistrationForm, SocialSignupForm
def main_page(request):
return render(request, 'widget.html')
+class SocialSignupView(SignupView):
+ form_class = SocialSignupForm
+
+
def exception_test(request):
msg = request.GET.get('msg')
if msg: