Skip to content
Snippets Groups Projects
Commit a39c79b9 authored by Christian Dresen's avatar Christian Dresen
Browse files

[WarpMain] Mattermost Hook for News

parent 0434a1fd
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ from django.http import HttpResponse
from warpmain.models import News, NewsForm
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from warpzone.util import send_to_mattermost
@login_required(login_url=settings.LOGIN_URL, redirect_field_name=None)
def index(request, news_id=0):
......@@ -16,6 +16,7 @@ def index(request, news_id=0):
news = news_form.save()
news.user = request.user.ldap_username
news.save()
send_to_mattermost(news.user, "town-square","### "+news.title+"\n"+news.message)
return redirect("News")
else:
page_context['collapse'] = "in"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment