Skip to content

Commit

Permalink
Adding command to send notification messages
Browse files Browse the repository at this point in the history
  • Loading branch information
superalex authored and bameda committed Jan 4, 2016
1 parent 5b83e8c commit 7eb138c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@
- Improve the django admin panel, now it is more usable and all the selector fields works properly.
- [API] Add tribe_gig field to user stories (improve integration between Taiga and Taiga Tribe).
- [API] Performance improvements for project stats.
- [Events] Add command to send an instant notifications to all the currently online users.
- Lots of small and not so small bugfixes.


Expand All @@ -24,7 +25,8 @@
- US, tasks and Issues can be upvoted or downvoted and the voters list can be obtained.
- Now users can watch public issues, tasks and user stories.
- Add endpoints to show the watchers list for issues, tasks and user stories.
- Add a "field type" property for custom fields: 'text', 'multiline text' and 'date' right now (thanks to [@artlepool](https://github.com/artlepool)).
- Add a "field type" property for custom fields: 'text', 'multiline text' and 'date' right nowi
(thanks to [@artlepool](https://github.com/artlepool)).
- Allow multiple actions in the commit messages.
- Now every user that coments USs, Issues or Tasks will be involved in it (add author to the watchers list).
- Now profile timelines only show content about the objects (US/Tasks/Issues/Wiki pages) you are involved.
Expand All @@ -50,7 +52,8 @@
- API: Improve and fix some errors in issues/filters_data and userstories/filters_data.
- API: resolver suport ref GET param and return a story, task or issue.
- Webhooks: Add deleted datetime to webhooks responses when isues, tasks or USs are deleted.
- Add headers to allow threading for notification emails about changes to issues, tasks, user stories, and wiki pages. (thanks to [@brett](https://github.com/brettp)).
- Add headers to allow threading for notification emails about changes to issues, tasks, user stories,
and wiki pages. (thanks to [@brett](https://github.com/brettp)).
- Lots of small and not so small bugfixes.


Expand Down
Empty file.
34 changes: 34 additions & 0 deletions taiga/events/management/commands/emit_notification_message.py
@@ -0,0 +1,34 @@
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from django.core.management.base import BaseCommand

from taiga.events.events import emit_event

class Command(BaseCommand):
help = 'Send a notification message to the current users'

def add_arguments(self, parser):
parser.add_argument("title", help="The title of the message.")
parser.add_argument("description", help="The description of the message.")

def handle(self, **options):
data = {
"title": options["title"],
"desc": options["description"],
}
routing_key = "notifications"
emit_event(data, routing_key)

0 comments on commit 7eb138c

Please sign in to comment.