Commit 05bb3661 authored by Christophe Siraut's avatar Christophe Siraut

Fix reverse links. Thanks to Joan.

parent 2e622212
......@@ -33,6 +33,7 @@ class UserProfile(models.Model):
user = models.OneToOneField(User)
email_notifications = models.BooleanField()
class Poll(models.Model):
# Override django id AutoField with randomly generated hash
id = models.CharField(
......
......@@ -11,11 +11,14 @@ urlpatterns = patterns(
login_required(UpdateView.as_view(
queryset=Poll.objects.all(),
form_class=PollForm,
success_url='choices/'))),
success_url='choices/')),
name="edit"),
url(r'^(?P<poll_id>\w{4,6})/$',
'meetingpoll.views.vote',
name='meetingpoll'),
url(r'^(?P<poll_id>\w{4,6})/delete/$', 'meetingpoll.views.delete'),
url(r'^(?P<poll_id>\w{4,6})/delete/$',
'meetingpoll.views.delete',
name="delete"),
url(r'^(?P<poll_id>\w{4,6})/edit/choices/$',
'meetingpoll.views.editchoices',
name='choices'),
......
......@@ -26,8 +26,7 @@ urlpatterns = patterns('',
name='languages'),
url(r'^accounts/profile/$', 'meetingpoll.views.profile', name='profile'),
url(r'^(?P<poll_id>\w{4,6})/$',
'meetingpoll.views.vote',
name='meetingpoll'),
'meetingpoll.views.vote'),
)
urlpatterns += i18n_patterns('',
......
......@@ -31,9 +31,9 @@
{% if polls %}
<ul>
{% for poll in polls %}
<li><a href="{{ poll.link }}">{{ poll.title }}</a> :
<a href="{{ poll.link }}edit/">{% trans "edit" %}</a> -
<a href="{{ poll.link }}delete/" onclick="return confirm('{% trans "Are you sure you want to delete this poll?" %}');">{% trans "delete" %}</a></li>
<li><a href="{% url 'meetingpoll' poll.id %}">{{ poll.title }}</a> :
<a href="{% url 'edit' poll.id %}">{% trans "edit" %}</a> -
<a href="{% url 'delete' poll.id %}" onclick="return confirm('{% trans "Are you sure you want to delete this poll?" %}');">{% trans "delete" %}</a></li>
{% endfor %}
</ul>
{% else %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment