generated from superdesk/newsroom-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/cn-uat' into uat
- Loading branch information
Showing
26 changed files
with
4,916 additions
and
9,711 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1 @@ | ||
const path = require('path'); | ||
const config = require('newsroom-core/webpack.config'); | ||
|
||
config.entry.login = path.resolve(__dirname, 'src', 'login.js'); | ||
config.entry.reset_password = path.resolve(__dirname, 'src', 'reset-password.js'); | ||
|
||
module.exports = config; | ||
module.exports = require('newsroom-core/webpack.config') |
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
from . import fix_language # noqa | ||
from . import fix_mediaformat # noqa |
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,35 @@ | ||
import time | ||
|
||
from superdesk import get_resource_service | ||
from cp.signals import get_media_type_name, get_media_type_scheme | ||
from newsroom.commands.manager import manager | ||
|
||
|
||
@manager.command | ||
def fix_mediaformat(resource="items", limit=500, sleep_secs=2): | ||
service = get_resource_service(resource) | ||
media_type_scheme = get_media_type_scheme() | ||
source = { | ||
"query": { | ||
"bool": {"must_not": {"term": {"subject.scheme": media_type_scheme}}} | ||
}, | ||
"size": 100, | ||
} | ||
for i in range(int(limit)): | ||
items = service.search(source) | ||
if not items.count(): | ||
break | ||
for item in items: | ||
updates = {"subject": item["subject"].copy() if item.get("subject") else []} | ||
updates["subject"].append( | ||
dict( | ||
code="wiretext", | ||
name=get_media_type_name("wiretext", item.get("language")), | ||
scheme=media_type_scheme, | ||
) | ||
) | ||
|
||
service.system_update(item["_id"], updates, item) | ||
print(".", end="", flush=True) | ||
time.sleep(int(sleep_secs)) | ||
print("done.") |
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
Oops, something went wrong.