def on_update(self, updates, original): if not original.get('firstpublished'): updates.setdefault('firstpublished', utcnow()) updates[ITEM_OPERATION] = self.item_operation super().on_update(updates, original) set_sign_off(updates, original) update_word_count(updates)
def on_update(self, updates, original): if 'firstpublished' not in original: updates.setdefault('firstpublished', utcnow()) updates[ITEM_OPERATION] = ITEM_PUBLISH super().on_update(updates, original) set_sign_off(updates, original) update_word_count(updates)
def on_update(self, updates, original): if not original.get('firstpublished'): updates.setdefault('firstpublished', utcnow()) if original.get('marked_for_user'): # remove marked_for_user on publish and keep it as previous_marked_user for history updates['previous_marked_user'] = original['marked_for_user'] updates['marked_for_user'] = None updates[ITEM_OPERATION] = self.item_operation super().on_update(updates, original) set_sign_off(updates, original) update_word_count(updates)
def on_update(self, updates, original): updates[ITEM_OPERATION] = self.item_operation super().on_update(updates, original) if not original.get("firstpublished"): if updates.get(SCHEDULE_SETTINGS) and updates[SCHEDULE_SETTINGS].get("utc_publish_schedule"): updates["firstpublished"] = updates[SCHEDULE_SETTINGS]["utc_publish_schedule"] else: updates["firstpublished"] = utcnow() if original.get("marked_for_user"): # remove marked_for_user on publish and keep it as previous_marked_user for history updates["previous_marked_user"] = original["marked_for_user"] updates["marked_for_user"] = None updates["marked_for_sign_off"] = None set_sign_off(updates, original) update_word_count(updates) self.set_desk(updates, original)
def on_update(self, updates, original): updates[ITEM_OPERATION] = ITEM_PUBLISH super().on_update(updates, original) set_sign_off(updates, original) update_word_count(updates)