Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a user I want to have the Coming Up field active when I create a new story, add current time T + 45 minutes [SDBELGA-466] #366

Merged
merged 2 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions server/belga/signals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def init_app(_app):
# generate id for belga url
item_create.connect(generate_id_for_url.handle_create)
item_update.connect(generate_id_for_url.handle_update)
# update date time for coming up field
item_create.connect(update.set_coming_up_field)
# unmark user when moved to incoming stage
item_move.connect(unmark_user_when_moved_to_incoming_stage.unmark_user)
# change profile from ALERT to TEXT on update
Expand Down
7 changes: 1 addition & 6 deletions server/belga/signals/update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from superdesk import get_resource_service
from superdesk.metadata.item import CONTENT_STATE
from superdesk.utc import utcnow
from datetime import timedelta

TEXT = 'TEXT'
ALERT = 'ALERT'
Expand Down Expand Up @@ -30,9 +31,3 @@ def handle_coming_up_field(sender, item, original, **kwargs):
# Disable and empty date time for coming_up field
if original.get("extra", {}).get("DueBy"):
item["extra"]["DueBy"] = None


def set_coming_up_field(sender, item):
# update date time for coming up field
if item.get("extra", {}).get("DueBy"):
item["extra"]["DueBy"] = utcnow()