Fix weekmail new article link

This commit is contained in:
Skia 2017-03-24 14:01:05 +01:00
parent 39b32d456c
commit 3cf1628435
3 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<h4>{% trans %}Communication:{% endtrans %}</h4> <h4>{% trans %}Communication:{% endtrans %}</h4>
<ul> <ul>
<li> <a href="{{ url('com:news_new') }}?club={{ object.id }}">{% trans %}Create a news{% endtrans %}</a></li> <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> </ul>
<h4>{% trans %}Counters:{% endtrans %}</h4> <h4>{% trans %}Counters:{% endtrans %}</h4>
<ul> <ul>

View File

@ -9,7 +9,7 @@ urlpatterns = [
url(r'^sith/edit/weekmail_destinations$', WeekmailDestinationEditView.as_view(), name='weekmail_destinations'), url(r'^sith/edit/weekmail_destinations$', WeekmailDestinationEditView.as_view(), name='weekmail_destinations'),
url(r'^weekmail$', WeekmailEditView.as_view(), name='weekmail'), url(r'^weekmail$', WeekmailEditView.as_view(), name='weekmail'),
url(r'^weekmail/preview$', WeekmailPreviewView.as_view(), name='weekmail_preview'), 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]+)/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'^weekmail/article/(?P<article_id>[0-9]+)/edit$', WeekmailArticleEditView.as_view(), name='weekmail_article_edit'),
url(r'^news$', NewsListView.as_view(), name='news_list'), url(r'^news$', NewsListView.as_view(), name='news_list'),

View File

@ -333,7 +333,7 @@ class WeekmailArticleCreateView(QuickNotifMixin, CreateView): #XXX need to prote
def get_initial(self): def get_initial(self):
init = {} init = {}
try: 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 except: pass
return init return init