Commit 3cf16284 authored by Skia's avatar Skia

Fix weekmail new article link

parent 39b32d45
Pipeline #816 failed with stage
......@@ -6,7 +6,7 @@
<h4>{% trans %}Communication:{% endtrans %}</h4>
<ul>
<li> <a href="{{ url('com:news_new') }}?club={{ object.id }}">{% trans %}Create a news{% endtrans %}</a></li>
<li> <a href="{{ url('com:weekmail_article', club_id=object.id) }}">{% trans %}Post in the Weekmail{% endtrans %}</a></li>
<li> <a href="{{ url('com:weekmail_article') }}?club={{ object.id }}">{% trans %}Post in the Weekmail{% endtrans %}</a></li>
</ul>
<h4>{% trans %}Counters:{% endtrans %}</h4>
<ul>
......
......@@ -9,7 +9,7 @@ urlpatterns = [
url(r'^sith/edit/weekmail_destinations$', WeekmailDestinationEditView.as_view(), name='weekmail_destinations'),
url(r'^weekmail$', WeekmailEditView.as_view(), name='weekmail'),
url(r'^weekmail/preview$', WeekmailPreviewView.as_view(), name='weekmail_preview'),
url(r'^weekmail/club/((?P<club_id>[0-9]+)/)?new_article$', WeekmailArticleCreateView.as_view(), name='weekmail_article'),
url(r'^weekmail/new_article$', WeekmailArticleCreateView.as_view(), name='weekmail_article'),
url(r'^weekmail/article/(?P<article_id>[0-9]+)/delete$', WeekmailArticleDeleteView.as_view(), name='weekmail_article_delete'),
url(r'^weekmail/article/(?P<article_id>[0-9]+)/edit$', WeekmailArticleEditView.as_view(), name='weekmail_article_edit'),
url(r'^news$', NewsListView.as_view(), name='news_list'),
......
......@@ -333,7 +333,7 @@ class WeekmailArticleCreateView(QuickNotifMixin, CreateView): #XXX need to prote
def get_initial(self):
init = {}
try:
init['club'] = Club.objects.filter(id=self.kwargs['club_id']).first()
init['club'] = Club.objects.filter(id=self.request.GET['club']).first()
except: pass
return init
......
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