[python-django-profile] Updated to support Django 1.5
Miro Hrončok
churchyard at fedoraproject.org
Wed May 15 11:31:12 UTC 2013
commit d704a2efe4e6fe071d0dc62a8a9e4dc5a85c10f0
Author: Miro Hrončok <miro at hroncok.cz>
Date: Wed May 15 13:30:46 2013 +0200
Updated to support Django 1.5
python-django-profile-django15.patch | 520 ++++++++++++++++++++++++++++++++++
python-django-profile.spec | 13 +-
2 files changed, 531 insertions(+), 2 deletions(-)
---
diff --git a/python-django-profile-django15.patch b/python-django-profile-django15.patch
new file mode 100644
index 0000000..ed834f4
--- /dev/null
+++ b/python-django-profile-django15.patch
@@ -0,0 +1,520 @@
+diff --git a/demo/settings.py b/demo/settings.py
+index 5e2bb38..aa1c93b 100644
+--- a/demo/settings.py
++++ b/demo/settings.py
+@@ -12,12 +12,17 @@ ADMINS = (
+
+ MANAGERS = ADMINS
+
+-DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+-DATABASE_NAME = '%s/database.db' % PROJECT_PATH # Or path to database file if using sqlite3.
+-DATABASE_USER = '' # Not used with sqlite3.
+-DATABASE_PASSWORD = '' # Not used with sqlite3.
+-DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
+-DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
++DATABASES = {
++ 'default': {
++ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
++ 'NAME': '%s/database.db' % PROJECT_PATH, # Or path to database file if using sqlite3.
++ # The following settings are not used with sqlite3:
++ 'USER': '',
++ 'PASSWORD': '',
++ 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
++ 'PORT': '', # Set to empty string for default.
++ }
++}
+
+ # Local time zone for this installation. Choices can be found here:
+ # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+@@ -57,9 +62,9 @@ SECRET_KEY = '@@6g99inmvqmt+d786%msz1r(lap_)o+ammt*2)gf8b=w1 at 1s$'
+
+ # List of callables that know how to import templates from various sources.
+ TEMPLATE_LOADERS = (
+- 'django.template.loaders.filesystem.load_template_source',
+- 'django.template.loaders.app_directories.load_template_source',
+-# 'django.template.loaders.eggs.load_template_source',
++ 'django.template.loaders.filesystem.Loader',
++ 'django.template.loaders.app_directories.Loader',
++# 'django.template.loaders.eggs.Loader',
+ )
+
+ MIDDLEWARE_CLASSES = (
+@@ -71,12 +76,6 @@ MIDDLEWARE_CLASSES = (
+
+ ROOT_URLCONF = 'demo.urls'
+
+-# e-mail settings
+-DEFAULT_FROM_EMAIL = ''
+-EMAIL_HOST = ''
+-EMAIL_HOST_USER = ''
+-EMAIL_HOST_PASSWORD = ''
+-
+ TEMPLATE_DIRS = (
+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Always use forward slashes, even on Windows.
+diff --git a/demo/templates/base.html b/demo/templates/base.html
+index f0c460e..c9f1bc9 100644
+--- a/demo/templates/base.html
++++ b/demo/templates/base.html
+@@ -27,11 +27,11 @@
+ <ul class="hmenu large three">
+ <li><a href="/">{% trans "Frontpage" %}</a></li>
+ {% if user.is_authenticated %}
+- <li><a href="{% url profile_overview %}">{% trans "Profile" %}</a></li>
+- <li><a href="{% url logout %}">{% trans "Logout" %}</a></li>
++ <li><a href="{% url "profile_overview" %}">{% trans "Profile" %}</a></li>
++ <li><a href="{% url "logout" %}">{% trans "Logout" %}</a></li>
+ {% else %}
+- <li><a href="{% url profile_overview %}">{% trans "Login" %}</a></li>
+- <li><a href="{% url signup %}">{% trans "Register" %}</a></li>
++ <li><a href="{% url "profile_overview" %}">{% trans "Login" %}</a></li>
++ <li><a href="{% url "signup" %}">{% trans "Register" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+diff --git a/demo/urls.py b/demo/urls.py
+index fbfcf6d..7e93c0d 100644
+--- a/demo/urls.py
++++ b/demo/urls.py
+@@ -1,22 +1,23 @@
+-from django.conf.urls.defaults import *
++from django.conf.urls import *
+ from django.contrib import admin
+-from django.views.generic.simple import direct_to_template
++from django.views.generic import TemplateView
+ from django.conf import settings
+ from userprofile.views import get_profiles
+
+ admin.autodiscover()
+
++
+ urlpatterns = patterns('',
+
+ # Demo FrontPage$
+- (r'^$', direct_to_template, {'extra_context': { 'profiles': get_profiles }, 'template': 'front.html' }),
++ (r'^$', TemplateView.as_view(template_name='front.html'), {'extra_context': { 'profiles': get_profiles }}),
+
+ # Profile application
+ (r'^accounts/', include('userprofile.urls')),
+
+ # Admin (not really needed)
+ (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+- (r'^admin/(.*)', admin.site.root),
++ (r'^admin/', include(admin.site.urls)),
+ )
+
+ # Serves media content. WARNING!! Only for development uses.
+diff --git a/userprofile/templates/userprofile/account/email_validation_done.html b/userprofile/templates/userprofile/account/email_validation_done.html
+index 9de1902..4aaa0b4 100644
+--- a/userprofile/templates/userprofile/account/email_validation_done.html
++++ b/userprofile/templates/userprofile/account/email_validation_done.html
+@@ -21,6 +21,6 @@
+ {% block userprofile_content_related %}
+ <div class="box">
+ <h3>{% trans "E-mail validation process" %}</h3>
+- <p>{% trans "You can manage the e-mail validation process from the" %} <a href="{% url profile_overview %}">{% trans "overview page" %}.</p>
++ <p>{% trans "You can manage the e-mail validation process from the" %} <a href="{% url "profile_overview" %}">{% trans "overview page" %}.</p>
+ </div>
+ {% endblock %}
+diff --git a/userprofile/templates/userprofile/account/email_validation_reset_response.html b/userprofile/templates/userprofile/account/email_validation_reset_response.html
+index de326d7..669c7a9 100644
+--- a/userprofile/templates/userprofile/account/email_validation_reset_response.html
++++ b/userprofile/templates/userprofile/account/email_validation_reset_response.html
+@@ -20,6 +20,6 @@
+ {% block userprofile_content_related %}
+ <div class="box">
+ <h3>{% trans "E-mail validation process" %}</h3>
+- <p>{% trans "You can manage the e-mail validation process from the" %} <a href="{% url profile_overview %}">{% trans "overview page" %}</a>.</p>
++ <p>{% trans "You can manage the e-mail validation process from the" %} <a href="{% url "profile_overview" %}">{% trans "overview page" %}</a>.</p>
+ </div>
+ {% endblock %}
+diff --git a/userprofile/templates/userprofile/account/includes/registration_form.html b/userprofile/templates/userprofile/account/includes/registration_form.html
+index 5475db7..c190e06 100644
+--- a/userprofile/templates/userprofile/account/includes/registration_form.html
++++ b/userprofile/templates/userprofile/account/includes/registration_form.html
+@@ -1,5 +1,5 @@
+ {% load i18n %}
+- <form action="{% url signup %}" method="post" accept-charset="utf-8">{% csrf_token %}
++ <form action="{% url "signup" %}" method="post" accept-charset="utf-8">{% csrf_token %}
+ <fieldset>
+ <legend>{% trans "User registration" %}</legend>
+ {% for field in form.visible_fields %}
+diff --git a/userprofile/templates/userprofile/account/login.html b/userprofile/templates/userprofile/account/login.html
+index 1271717..28fcecd 100644
+--- a/userprofile/templates/userprofile/account/login.html
++++ b/userprofile/templates/userprofile/account/login.html
+@@ -41,11 +41,11 @@
+ <div class="box">
+ <h3>{% trans "Utilities" %}:</h3>
+ {# http://code.djangoproject.com/ticket/7239 #}
+- <a href="{% url password_reset %}">{% trans "Lost your password?" %}</a>
++ <a href="{% url "password_reset" %}">{% trans "Lost your password?" %}</a>
+ <br />
+- <a href="{% url email_validation_reset %}">{% trans "Resend validation e-mail" %}</a>
++ <a href="{% url "email_validation_reset" %}">{% trans "Resend validation e-mail" %}</a>
+ <br />
+- <a href="{% url signup %}">{% trans "Sign up!" %}</a>
++ <a href="{% url "signup" %}">{% trans "Sign up!" %}</a>
+ <br />
+ </div>
+ {% endblock %}
+diff --git a/userprofile/templates/userprofile/account/logout.html b/userprofile/templates/userprofile/account/logout.html
+index a320edf..82d77bd 100644
+--- a/userprofile/templates/userprofile/account/logout.html
++++ b/userprofile/templates/userprofile/account/logout.html
+@@ -7,6 +7,6 @@
+ {% block userprofile_content %}
+ <div class="notice">
+ <h3>{% trans "Logged out" %}</h3>
+- <p class="large">{% trans "You've been logged out" %}. (<a href="{% url profile_overview %}">{% trans 'Log in again' %}</a>)</p>
++ <p class="large">{% trans "You've been logged out" %}. (<a href="{% url "profile_overview" %}">{% trans 'Log in again' %}</a>)</p>
+ </div>
+ {% endblock %}
+diff --git a/userprofile/templates/userprofile/account/registration_done.html b/userprofile/templates/userprofile/account/registration_done.html
+index 07cc306..61a9e25 100644
+--- a/userprofile/templates/userprofile/account/registration_done.html
++++ b/userprofile/templates/userprofile/account/registration_done.html
+@@ -7,9 +7,9 @@
+ {% block userprofile_content %}
+ <div class="success">
+ {% if email_validation_required %}
+- <p>{% blocktrans %}You have successfully registered a new account, and an account activation url has been sent to your e-mail address. You must access this message on your e-mail account to finish the registration process.{% endblocktrans %}</p>
++ <p>{% blocktrans %}You have successfully registered a new account, and an account activation url "has" been sent to your e-mail address. You must access this message on your e-mail account to finish the registration process.{% endblocktrans %}</p>
+ {% else %}
+- {% url profile_overview as overview_url %}
++ {% url "profile_overview" as overview_url %}
+ <p>{% blocktrans %}You have successfully registered a new account. Go to the <a href="{{ overview_url }}">login page</a> to authenticate and start using this site.{% endblocktrans %}</p>
+ {% endif %}
+ </div>
+diff --git a/userprofile/templates/userprofile/avatar/choose.html b/userprofile/templates/userprofile/avatar/choose.html
+index 1b63dc7..04771d8 100644
+--- a/userprofile/templates/userprofile/avatar/choose.html
++++ b/userprofile/templates/userprofile/avatar/choose.html
+@@ -59,7 +59,7 @@
+
+ <div class="photos">
+ {% for thumb,url in images.items %}
+- <a href="{{ url }}"><img alt="photo{{ forloop.counter }}" src="{{ thumb }}" /></a>
++ <a href="{{ url }}""><img alt="photo{{ forloop.counter }}" src="{{ thumb }}" /></a>
+ {% endfor %}
+ </div>
+ </li>
+@@ -83,6 +83,6 @@
+ {% load avatars %}
+ <div class="center">
+ <img class="border" alt="{{ user }}" id="avatarimg" src="{% avatar DEFAULT_AVATAR_SIZE %}" />
+- {% if user.get_profile.has_avatar %}<p id="avatardelete" style="text-align: center;"><a href="{% url profile_avatar_delete %}" class="delavatar">{% trans "Delete" %}</a></p>{% endif %}
++ {% if user.get_profile.has_avatar %}<p id="avatardelete" style="text-align: center;"><a href="{% url "profile_avatar_delete" %}" class="delavatar">{% trans "Delete" %}</a></p>{% endif %}
+ </div>
+ {% endblock %}
+diff --git a/userprofile/templates/userprofile/avatar/crop.html b/userprofile/templates/userprofile/avatar/crop.html
+index fc133e2..1dca795 100644
+--- a/userprofile/templates/userprofile/avatar/crop.html
++++ b/userprofile/templates/userprofile/avatar/crop.html
+@@ -15,7 +15,7 @@
+ {% endblock %}
+
+ {% block userprofile_content %}
+- <form name="cropavatar" action="{% url profile_avatar_crop %}" method="post" accept-charset="utf-8">{% csrf_token %}
++ <form name="cropavatar" action="{% url "profile_avatar_crop" %}" method="post" accept-charset="utf-8">{% csrf_token %}
+ <fieldset>
+ <legend style='display:none'>{% trans "Crop & resize the area you want" %}</legend>
+
+diff --git a/userprofile/templates/userprofile/email/password_reset_email.txt b/userprofile/templates/userprofile/email/password_reset_email.txt
+index a2aca13..1f2570f 100644
+--- a/userprofile/templates/userprofile/email/password_reset_email.txt
++++ b/userprofile/templates/userprofile/email/password_reset_email.txt
+@@ -4,7 +4,7 @@
+
+ {% trans "Please go to the following page and choose a new password:" %}
+ {% block reset_link %}
+-{{ protocol }}://{{ domain }}{% url password_reset_confirm uidb36=uid,token=token %}
++{{ protocol }}://{{ domain }}{% url "password_reset_confirm" uidb36=uid,token=token %}
+ {% endblock %}
+ {% trans "Your username, in case you've forgotten:" %} {{ user.username }}
+
+diff --git a/userprofile/templates/userprofile/email/validation.txt b/userprofile/templates/userprofile/email/validation.txt
+index df7cd97..9812b5e 100644
+--- a/userprofile/templates/userprofile/email/validation.txt
++++ b/userprofile/templates/userprofile/email/validation.txt
+@@ -3,7 +3,7 @@
+
+ {% trans "Following this link, you will validate your e-mail address:" %}
+
+-http://{{ domain }}{% url email_validation_process key %}
++http://{{ domain }}{% url "email_validation_process" key %}
+
+ {% trans "Your username, in case you've forgotten:" %} {{ user.username }}
+
+diff --git a/userprofile/templates/userprofile/menu.html b/userprofile/templates/userprofile/menu.html
+index c903b23..488a356 100644
+--- a/userprofile/templates/userprofile/menu.html
++++ b/userprofile/templates/userprofile/menu.html
+@@ -2,11 +2,11 @@
+ {% if user.is_authenticated %}
+ <div id="nav" class="{{ css_classes.nav }}">
+ <ul class="hmenu">
+- <li{% ifequal section "overview" %} class="active"{% endifequal %}><a href="{% url profile_overview %}">{% trans "Overview" %}</a></li>
+- <li{% ifequal section "personal" %} class="active"{% endifequal %}><a href="{% url profile_edit_personal %}">{% trans "Personal information" %}</a></li>
+- <li{% ifequal section "avatar" %} class="active"{% endifequal %}><a href="{% url profile_edit_avatar %}">{% trans "Avatar" %}</a></li>
+- <li{% ifequal section "location" %} class="active"{% endifequal %}><a href="{% url profile_edit_location %}">{% trans "Location" %}</a></li>
+- <li{% ifequal section "delete" %} class="active"{% endifequal %}><a href="{% url profile_delete %}">{% trans "Remove profile" %}</a></li>
++ <li{% ifequal section "overview" %} class="active"{% endifequal %}><a href="{% url "profile_overview" %}">{% trans "Overview" %}</a></li>
++ <li{% ifequal section "personal" %} class="active"{% endifequal %}><a href="{% url "profile_edit_personal" %}">{% trans "Personal information" %}</a></li>
++ <li{% ifequal section "avatar" %} class="active"{% endifequal %}><a href="{% url "profile_edit_avatar" %}">{% trans "Avatar" %}</a></li>
++ <li{% ifequal section "location" %} class="active"{% endifequal %}><a href="{% url "profile_edit_location" %}">{% trans "Location" %}</a></li>
++ <li{% ifequal section "delete" %} class="active"{% endifequal %}><a href="{% url "profile_delete" %}">{% trans "Remove profile" %}</a></li>
+ </ul>
+ <hr class="space" />
+ </div>
+diff --git a/userprofile/templates/userprofile/profile/location.html b/userprofile/templates/userprofile/profile/location.html
+index d3515db..ede956d 100644
+--- a/userprofile/templates/userprofile/profile/location.html
++++ b/userprofile/templates/userprofile/profile/location.html
+@@ -15,7 +15,7 @@
+ {% endblock %}
+
+ {% block userprofile_content %}
+- <form action="{% url profile_edit_location %}" method="post" enctype="multipart/form-data">{% csrf_token %}
++ <form action="{% url "profile_edit_location" %}" method="post" enctype="multipart/form-data">{% csrf_token %}
+ {{ form.errors }}
+ <fieldset>
+ <legend>{% trans "Define your location" %}{% if geoip %} (<a href="?ip=1">{% trans "Auto-discover location" %}</a>){% endif %}</legend>
+@@ -29,7 +29,7 @@
+ </div>
+ <div class="hide">{{ form.location }}{{ form.latitude }}{{ form.longitude }}</div>
+ <input type='hidden' name='_apikey' id="google_maps_apikey" value="{{ GOOGLE_MAPS_API_KEY }}" />
+- <input type='hidden' name='_fetch_geodata_url' id="fetch_geodata_url" value="{% url profile_geocountry_info 0 0 %}" />
++ <input type='hidden' name='_fetch_geodata_url' id="fetch_geodata_url" value="{% url "profile_geocountry_info" 0 0 %}" />
+ {% endif %}
+ </fieldset>
+ <p><input type="submit" value="{% trans 'Save' %}" /></p>
+diff --git a/userprofile/templates/userprofile/profile/overview.html b/userprofile/templates/userprofile/profile/overview.html
+index 1943657..1327fc2 100644
+--- a/userprofile/templates/userprofile/profile/overview.html
++++ b/userprofile/templates/userprofile/profile/overview.html
+@@ -31,10 +31,10 @@
+ <fieldset>
+ <legend>{% trans "Overview of your profile" %}</legend>
+ <div id="avatar" class="{{ css_classes.overview_avatar }} center">
+- <a href="{% url profile_edit_avatar %}">
++ <a href="{% url "profile_edit_avatar" %}">
+ <img class="border" src="{% avatar DEFAULT_AVATAR_SIZE %}" />
+ </a>
+- <p><a href="{% url profile_edit_avatar %}">{% if user.get_profile.has_avatar %}{% trans "Change avatar" %}{% else %}{% trans "Add avatar" %}{% endif %}</a></p>
++ <p><a href="{% url "profile_edit_avatar" %}">{% if user.get_profile.has_avatar %}{% trans "Change avatar" %}{% else %}{% trans "Add avatar" %}{% endif %}</a></p>
+ </div>
+
+ <div class="{{ css_classes.overview_details }}">
+@@ -89,16 +89,16 @@
+ {% block userprofile_content_related %}
+ <div class="box">
+ <h3>{% trans "Management:" %}</h3>
+- <a href="{% url password_change %}">{% trans "Change password" %}</a>
++ <a href="{% url "password_change" %}">{% trans "Change password" %}</a>
+ <br />
+- <a href="{% url email_validation %}">{% if email %}{% trans "Change your e-mail address" %}{% else %}{% trans "Add your e-mail address" %}{% endif %}</a>
+- {% if not validated and email %}<br /><a href="{% url email_validation_reset %}">{% trans "Resend validation e-mail" %}</a>
++ <a href="{% url "email_validation" %}">{% if email %}{% trans "Change your e-mail address" %}{% else %}{% trans "Add your e-mail address" %}{% endif %}</a>
++ {% if not validated and email %}<br /><a href="{% url "email_validation_reset" %}">{% trans "Resend validation e-mail" %}</a>
+ {% endif %}
+ <br />
+ {% if not user.get_profile.location %}
+- <a href="{% url profile_edit_location %}">{% trans "Add location" %}</a>
++ <a href="{% url "profile_edit_location" %}">{% trans "Add location" %}</a>
+ {% else %}
+- <a href="{% url profile_edit_location %}">{% trans "Change location" %}</a>
++ <a href="{% url "profile_edit_location" %}">{% trans "Change location" %}</a>
+ {% endif %}
+ </div>
+ {% endblock %}
+diff --git a/userprofile/templates/userprofile/profile/personal.html b/userprofile/templates/userprofile/profile/personal.html
+index 77eaf28..44849f0 100644
+--- a/userprofile/templates/userprofile/profile/personal.html
++++ b/userprofile/templates/userprofile/profile/personal.html
+@@ -22,7 +22,7 @@
+ {% endblock %}
+
+ {% block userprofile_content %}
+- <form class="personal" action="{% url profile_edit_personal %}" method="post" enctype="multipart/form-data">{% csrf_token %}
++ <form class="personal" action="{% url "profile_edit_personal" %}" method="post" enctype="multipart/form-data">{% csrf_token %}
+ <fieldset>
+ <legend>{% trans "Edit your personal information" %}</legend>
+ {{ form.as_p }}
+diff --git a/userprofile/urls/en.py b/userprofile/urls/en.py
+index a11e33c..3dde5af 100644
+--- a/userprofile/urls/en.py
++++ b/userprofile/urls/en.py
+@@ -1,5 +1,5 @@
+-from django.conf.urls.defaults import *
+-from django.views.generic.simple import direct_to_template
++from django.conf.urls import *
++from django.views.generic import TemplateView
+ from userprofile.views import *
+ from django.conf import settings
+
+@@ -26,16 +26,14 @@ urlpatterns = patterns('',
+ url(r'^profile/edit/avatar/crop/$', avatarcrop,
+ name='profile_avatar_crop'),
+
+- url(r'^profile/edit/avatar/crop/done/$', direct_to_template,
+- { 'extra_context': {'section': 'avatar'},
+- 'template': 'userprofile/avatar/done.html'},
++ url(r'^profile/edit/avatar/crop/done/$', TemplateView.as_view(template_name='userprofile/avatar/done.html'),
++ { 'extra_context': {'section': 'avatar'}},
+ name='profile_avatar_crop_done'),
+
+ # Account utilities
+ url(r'^email/validation/$', email_validation, name='email_validation'),
+
+- url(r'^email/validation/processed/$', direct_to_template,
+- {'template': 'userprofile/account/email_validation_processed.html'},
++ url(r'^email/validation/processed/$', TemplateView.as_view(template_name='userprofile/account/email_validation_processed.html'),
+ name='email_validation_processed'),
+
+ url(r'^email/validation/(?P<key>.{70})/$', email_validation_process,
+@@ -45,8 +43,7 @@ urlpatterns = patterns('',
+ name='email_validation_reset'),
+
+ url(r'^email/validation/reset/(?P<action>done|failed)/$',
+- direct_to_template,
+- {'template' : 'userprofile/account/email_validation_reset_response.html'},
++ TemplateView.as_view(template_name='userprofile/account/email_validation_reset_response.html'),
+ name='email_validation_reset_response'),
+
+ url(r'^password/reset/$', 'django.contrib.auth.views.password_reset',
+@@ -89,13 +86,11 @@ urlpatterns = patterns('',
+ # Registration
+ url(r'^register/$', register, name='signup'),
+
+- url(r'^register/validate/$', direct_to_template,
+- {'template' : 'userprofile/account/validate.html'},
++ url(r'^register/validate/$', TemplateView.as_view(template_name='userprofile/account/validate.html'),
+ name='signup_validate'),
+
+- url(r'^register/complete/$', direct_to_template,
+- {'extra_context': { 'email_validation_required': hasattr(settings, "REQUIRE_EMAIL_CONFIRMATION") and settings.REQUIRE_EMAIL_CONFIRMATION },
+- 'template': 'userprofile/account/registration_done.html'},
++ url(r'^register/complete/$', TemplateView.as_view(template_name='userprofile/account/registration_done.html'),
++ {'extra_context': { 'email_validation_required': hasattr(settings, "REQUIRE_EMAIL_CONFIRMATION") and settings.REQUIRE_EMAIL_CONFIRMATION }},
+ name='signup_complete'),
+
+ # Users public profile
+diff --git a/userprofile/urls/es.py b/userprofile/urls/es.py
+index 13f7760..3b4b172 100644
+--- a/userprofile/urls/es.py
++++ b/userprofile/urls/es.py
+@@ -1,5 +1,5 @@
+-from django.conf.urls.defaults import *
+-from django.views.generic.simple import direct_to_template
++from django.conf.urls import *
++from django.views.generic import TemplateView
+ from userprofile.views import *
+ from django.conf import settings
+
+@@ -26,16 +26,14 @@ urlpatterns = patterns('',
+ url(r'^perfil/editar/avatar/recortar/$', avatarcrop,
+ name='profile_avatar_crop'),
+
+- url(r'^perfil/edit/avatar/recortar/listo/$', direct_to_template,
+- { 'extra_context': {'section': 'avatar'},
+- 'template': 'userprofile/avatar/done.html'},
++ url(r'^perfil/edit/avatar/recortar/listo/$', TemplateView.as_view(template_name='userprofile/avatar/done.html'),
++ { 'extra_context': {'section': 'avatar'}},
+ name='profile_avatar_crop_done'),
+
+ # Account utilities
+ url(r'^email/validar/$', email_validation, name='email_validation'),
+
+- url(r'^email/validar/procesado/$', direct_to_template,
+- {'template': 'userprofile/account/email_validation_processed.html'},
++ url(r'^email/validar/procesado/$', TemplateView.as_view(template_name='userprofile/account/email_validation_processed.html'),
+ name='email_validation_processed'),
+
+ url(r'^email/validar/(?P<key>.{70})/$', email_validation_process,
+@@ -45,8 +43,7 @@ urlpatterns = patterns('',
+ name='email_validation_reset'),
+
+ url(r'^email/validar/reestablecer/(?P<action>listo|fallo)/$',
+- direct_to_template,
+- {'template' : 'userprofile/account/email_validation_reset_response.html'},
++ TemplateView.as_view(template_name='userprofile/account/email_validation_reset_response.html'),
+ name='email_validation_reset_response'),
+
+ url(r'^password/reestablecer/$',
+@@ -90,13 +87,11 @@ urlpatterns = patterns('',
+ # Registration
+ url(r'^registro/$', register, name='signup'),
+
+- url(r'^registro/validar/$', direct_to_template,
+- {'template' : 'userprofile/account/validate.html'},
++ url(r'^registro/validar/$', TemplateView.as_view(template_name='userprofile/account/validate.html'),
+ name='signup_validate'),
+
+- url(r'^registro/completo/$', direct_to_template,
+- {'extra_context': { 'email_validation_required': hasattr(settings, "REQUIRE_EMAIL_CONFIRMATION") and settings.REQUIRE_EMAIL_CONFIRMATION },
+- 'template': 'userprofile/account/registration_done.html'},
++ url(r'^registro/completo/$', TemplateView.as_view(template_name='userprofile/account/registration_done.html'),
++ {'extra_context': { 'email_validation_required': hasattr(settings, "REQUIRE_EMAIL_CONFIRMATION") and settings.REQUIRE_EMAIL_CONFIRMATION }},
+ name='signup_complete'),
+
+ # Users public profile
+diff --git a/userprofile/urls/fr.py b/userprofile/urls/fr.py
+index 34fb03c..e752b2d 100644
+--- a/userprofile/urls/fr.py
++++ b/userprofile/urls/fr.py
+@@ -1,5 +1,5 @@
+-from django.conf.urls.defaults import *
+-from django.views.generic.simple import direct_to_template
++from django.conf.urls import *
++from django.views.generic import TemplateView
+ from userprofile.views import *
+ from django.conf import settings
+
+@@ -26,16 +26,14 @@ urlpatterns = patterns('',
+ url(r'^profil/edition/avatar/rognage/$', avatarcrop,
+ name='profile_avatar_crop'),
+
+- url(r'^profil/edition/avatar/rognage/fin/$', direct_to_template,
+- { 'extra_context': {'section': 'avatar'},
+- 'template': 'userprofile/avatar/done.html'},
++ url(r'^profil/edition/avatar/rognage/fin/$', TemplateView.as_view(template_name='userprofile/avatar/done.html'),
++ { 'extra_context': {'section': 'avatar'}},
+ name='profile_avatar_crop_done'),
+
+ # Account utilities
+ url(r'^email/validation/$', email_validation, name='email_validation'),
+
+- url(r'^email/validation/fin/$', direct_to_template,
+- {'template': 'userprofile/account/email_validation_processed.html'},
++ url(r'^email/validation/fin/$', TemplateView.as_view(template_name='userprofile/account/email_validation_processed.html'),
+ name='email_validation_processed'),
+
+ url(r'^email/validation/(?P<key>.{70})/$', email_validation_process,
+@@ -45,8 +43,7 @@ urlpatterns = patterns('',
+ name='email_validation_reset'),
+
+ url(r'^email/validation/reinitialisation/(?P<action>done|failed)/$',
+- direct_to_template,
+- {'template' : 'userprofile/account/email_validation_reset_response.html'},
++ TemplateView.as_view(template_name='userprofile/account/email_validation_reset_response.html'),
+ name='email_validation_reset_response'),
+
+ url(r'^motdepasse/reinitialisation/$', 'django.contrib.auth.views.password_reset',
+@@ -89,13 +86,11 @@ urlpatterns = patterns('',
+ # Registration
+ url(r'^enregistrement/$', register, name='signup'),
+
+- url(r'^enegistrement/validation/$', direct_to_template,
+- {'template' : 'userprofile/account/validate.html'},
++ url(r'^enegistrement/validation/$', TemplateView.as_view(template_name='userprofile/account/validate.html'),
+ name='signup_validate'),
+
+- url(r'^enregistrement/fin/$', direct_to_template,
+- {'extra_context': { 'email_validation_required': hasattr(settings, "REQUIRE_EMAIL_CONFIRMATION") and settings.REQUIRE_EMAIL_CONFIRMATION },
+- 'template': 'userprofile/account/registration_done.html'},
++ url(r'^enregistrement/fin/$', TemplateView.as_view(template_name='userprofile/account/registration_done.html'),
++ {'extra_context': { 'email_validation_required': hasattr(settings, "REQUIRE_EMAIL_CONFIRMATION") and settings.REQUIRE_EMAIL_CONFIRMATION }},
+ name='signup_complete'),
+
+ # Users public profile
diff --git a/python-django-profile.spec b/python-django-profile.spec
index 7b0e2c3..d8fd71f 100644
--- a/python-django-profile.spec
+++ b/python-django-profile.spec
@@ -2,12 +2,12 @@
%global vcsdate 20110216
%global vcstag r458
-%global release 2
+%global release 3
%global obs_ver 0.6-0.6.20090813svnr420
Name: python-%{upstream_name}
Version: 0.6
-Release: 0.%{release}.%{vcsdate}svn%{vcstag}%{?dist}.1
+Release: 0.%{release}.%{vcsdate}svn%{vcstag}%{?dist}
Summary: Django pluggable user profile zone
Group: Development/Languages
@@ -17,10 +17,13 @@ URL: http://code.google.com/p/django-profile/
# tar zcf django-profile-%%{version}-%%{vcstag}.tar.gz django-profile-%%{version}-%%{vcstag}
Source: %{upstream_name}-%{version}-%{vcstag}.tar.gz
+Patch0: %{name}-django15.patch
+
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
Requires: python-django
+Requires: python-gdata
Requires: python-imaging
Provides: django-profile = %{version}-%{release}
@@ -37,6 +40,8 @@ in the package.
%prep
%setup -q -n %{upstream_name}-%{version}-%{vcstag}
+%patch0 -p1
+
# this html file shouldn't be executable
chmod a-x userprofile/templates/userprofile/base_2col.html
@@ -64,6 +69,10 @@ find $RPM_BUILD_ROOT -type f -name '*.po' -exec rm {} \;
%exclude %{python_sitelib}/demo
%changelog
+* Fri May 10 2013 Miro Hrončok <mhroncok at redhat.com> - 0.6-0.3.20110216svnr458
+- Patched to support Django 1.5
+- Added Require python-gdata
+
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.6-0.2.20110216svnr458.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
More information about the scm-commits
mailing list