Skip to content

Commit

Permalink
As a user I want to have the Coming Up field active when I create a n…
Browse files Browse the repository at this point in the history
…ew story, add current time T + 45 minutes [SDBELGA-466] (#366)

* 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]

* Revert belga specific changes for
  • Loading branch information
GyanP authored Nov 19, 2021
1 parent caf7cc3 commit 637853a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
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()

0 comments on commit 637853a

Please sign in to comment.