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

[SDESK-4289](fix): Missing fields stored in Archive Statistics #106

Merged
merged 1 commit into from
May 20, 2019
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
16 changes: 15 additions & 1 deletion server/analytics/stats/archive_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from superdesk.services import BaseService
from superdesk.resource import Resource, not_indexed, not_analyzed, not_enabled
from superdesk.metadata.item import metadata_schema, FORMAT, ITEM_TYPE, ITEM_STATE, \
SCHEDULE_SETTINGS
SCHEDULE_SETTINGS, BYLINE
from superdesk.metadata.utils import item_url
from apps.archive.common import ARCHIVE_SCHEMA_FIELDS

Expand Down Expand Up @@ -233,6 +233,20 @@ class ArchiveStatisticsResource(Resource):
'stage': Resource.rel('stages', nullable=True)
}
},
'unique_id': metadata_schema['unique_id'],
'unique_name': metadata_schema['unique_name'],
'ingest_id': metadata_schema['ingest_id'],
'family_id': metadata_schema['family_id'],
'usageterms': metadata_schema['usageterms'],
'copyrightnotice': metadata_schema['copyrightnotice'],
'copyrightholder': metadata_schema['copyrightholder'],
'profile': metadata_schema['profile'],
BYLINE: metadata_schema[BYLINE],
'ednote': metadata_schema['ednote'],
'dateline': metadata_schema['dateline'],
'expiry': metadata_schema['expiry'],
'place': metadata_schema['place'],
'template': metadata_schema['template'],

'original_par_count': metadata_schema['word_count'],
'par_count': metadata_schema['word_count'],
Expand Down
7 changes: 5 additions & 2 deletions server/analytics/stats/gen_archive_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from superdesk.logging import logger
from superdesk.utc import utcnow
from superdesk.metadata.item import ITEM_STATE, ITEM_TYPE, FORMAT, SCHEDULE_SETTINGS, \
CONTENT_STATE, PUBLISH_SCHEDULE, EMBARGO
CONTENT_STATE, PUBLISH_SCHEDULE, EMBARGO, BYLINE
from superdesk.text_utils import get_par_count
from superdesk.celery_task_utils import get_lock_id
from superdesk.lock import lock, unlock
Expand Down Expand Up @@ -366,7 +366,10 @@ def set_metadata_updates(self, item, history):
'anpa_take_key', 'keywords', 'word_count', 'priority',
'urgency', ITEM_STATE, 'pubstatus', 'flags', 'sms_message',
FORMAT, 'auto_publish', 'assignment_id', 'rewrite_of', 'rewritten_by',
'original_id', SCHEDULE_SETTINGS, 'task', PUBLISH_SCHEDULE, EMBARGO
'original_id', SCHEDULE_SETTINGS, 'task', PUBLISH_SCHEDULE, EMBARGO,
'unique_id', 'unique_name', 'ingest_id', 'family_id', 'usageterms',
'copyrightnotice', 'copyrightholder', 'profile', BYLINE, 'ednote',
'dateline', 'expiry', 'place', 'template'
]

# Calculate and store item attributes that the history service removes
Expand Down