generated from superdesk/newsroom-app
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from petrjasek/set-planning-all-day
set incoming planning to last all day
- Loading branch information
Showing
10 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
INSTALLED_APPS = [ | ||
"stt.external_links", | ||
"stt.filters", | ||
"stt.signals", | ||
"newsroom.auth.saml", | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
from newsroom.signals import publish_planning | ||
|
||
|
||
def set_planning_all_day(app, item, **kwargs): | ||
item["dates"].setdefault("all_day", True) | ||
|
||
|
||
def init_app(app): | ||
publish_planning.connect(set_planning_all_day) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
from stt.signals import publish_planning, set_planning_all_day | ||
|
||
|
||
def test_publish_planning_signal(): | ||
publish_planning.connect(set_planning_all_day) | ||
item = {"dates": {"start": 1, "end": 1}} | ||
publish_planning.send(None, item=item, foo=1) | ||
assert item["dates"]["all_day"] is True |
File renamed without changes.