Skip to content

Commit 6ea73b3

Browse files
committed
Rename the event to PUBLISHED_NEXT
1 parent 6f0222c commit 6ea73b3

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

contentcuration/contentcuration/tests/viewsets/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from contentcuration.viewsets.sync.utils import generate_publish_event as base_generate_publish_event
1616
from contentcuration.viewsets.sync.utils import generate_update_event as base_generate_update_event
1717
from contentcuration.viewsets.sync.utils import generate_update_descendants_event as base_generate_update_descendants_event
18-
from contentcuration.viewsets.sync.utils import generate_publish_staging_tree_event as base_generate_publish_staging_tree_event
18+
from contentcuration.viewsets.sync.utils import generate_publish_next_event as base_generate_publish_next_event
1919

2020

2121
def generate_copy_event(*args, **kwargs):
@@ -67,8 +67,8 @@ def generate_publish_channel_event(channel_id):
6767
event["rev"] = random.randint(1, 10000000)
6868
return event
6969

70-
def generate_publish_staging_tree_event(channel_id):
71-
event = base_generate_publish_staging_tree_event(channel_id)
70+
def generate_publish_next_event(channel_id):
71+
event = base_generate_publish_next_event(channel_id)
7272
event["rev"] = random.randint(1, 10000000)
7373
return event
7474

contentcuration/contentcuration/tests/viewsets/test_channel.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from contentcuration.tests.viewsets.base import generate_delete_event
1818
from contentcuration.tests.viewsets.base import generate_deploy_channel_event
1919
from contentcuration.tests.viewsets.base import generate_publish_channel_event
20-
from contentcuration.tests.viewsets.base import generate_publish_staging_tree_event
20+
from contentcuration.tests.viewsets.base import generate_publish_next_event
2121
from contentcuration.tests.viewsets.base import generate_sync_channel_event
2222
from contentcuration.tests.viewsets.base import generate_update_event
2323
from contentcuration.tests.viewsets.base import SyncTestMixin
@@ -403,7 +403,7 @@ def test_publish_does_not_make_publishable(self):
403403

404404
self.assertEqual(_unpublished_changes_query(channel).count(), 0)
405405

406-
def test_publish_staging_tree(self):
406+
def test_publish_next(self):
407407
channel = testdata.channel()
408408
user = testdata.user()
409409
channel.editors.add(user)
@@ -423,15 +423,15 @@ def test_publish_staging_tree(self):
423423

424424
response = self.sync_changes(
425425
[
426-
generate_publish_staging_tree_event(channel.id)
426+
generate_publish_next_event(channel.id)
427427
]
428428
)
429429

430430
self.assertEqual(response.status_code, 200)
431431
modified_channel = models.Channel.objects.get(id=channel.id)
432432
self.assertEqual(modified_channel.staging_tree.published, True)
433433

434-
def test_publish_staging_tree_incomplete(self):
434+
def test_publish_next_with_incomplete_staging_tree(self):
435435
channel = testdata.channel()
436436
user = testdata.user()
437437
channel.editors.add(user)
@@ -448,7 +448,7 @@ def test_publish_staging_tree_incomplete(self):
448448

449449
response = self.sync_changes(
450450
[
451-
generate_publish_staging_tree_event(channel.id)
451+
generate_publish_next_event(channel.id)
452452
]
453453
)
454454

contentcuration/contentcuration/viewsets/channel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,18 +560,18 @@ def publish(self, pk, version_notes="", language=None):
560560
], applied=True, unpublishable=True)
561561
raise
562562

563-
def publish_staging_tree_from_changes(self, changes):
563+
def publish_next_from_changes(self, changes):
564564
errors = []
565565
for publish in changes:
566566
try:
567-
self.publish_staging_tree(publish["key"])
567+
self.publish_next(publish["key"])
568568
except Exception as e:
569569
log_sync_exception(e, user=self.request.user, change=publish)
570570
publish["errors"] = [str(e)]
571571
errors.append(publish)
572572
return errors
573573

574-
def publish_staging_tree(self, pk):
574+
def publish_next(self, pk):
575575
logging.debug("Entering the publish staging channel endpoint")
576576

577577
channel = self.get_edit_queryset().get(pk=pk)

contentcuration/contentcuration/viewsets/sync/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from contentcuration.viewsets.sync.constants import DELETED
2525
from contentcuration.viewsets.sync.constants import DEPLOYED
2626
from contentcuration.viewsets.sync.constants import UPDATED_DESCENDANTS
27-
from contentcuration.viewsets.sync.constants import STAGING_TREE_PUBLISHED
27+
from contentcuration.viewsets.sync.constants import PUBLISHED_NEXT
2828
from contentcuration.viewsets.sync.constants import EDITOR_M2M
2929
from contentcuration.viewsets.sync.constants import FILE
3030
from contentcuration.viewsets.sync.constants import INVITATION
@@ -97,7 +97,7 @@ def get_change_type(obj):
9797
SYNCED: "sync_from_changes",
9898
DEPLOYED: "deploy_from_changes",
9999
UPDATED_DESCENDANTS: "update_descendants_from_changes",
100-
STAGING_TREE_PUBLISHED: "publish_staging_tree_from_changes"
100+
PUBLISHED_NEXT: "publish_next_from_changes"
101101
}
102102

103103

contentcuration/contentcuration/viewsets/sync/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
SYNCED = 7
99
DEPLOYED = 8
1010
UPDATED_DESCENDANTS = 9
11-
STAGING_TREE_PUBLISHED = 10
11+
PUBLISHED_NEXT = 10
1212

1313

1414
ALL_CHANGES = set([
@@ -21,7 +21,7 @@
2121
SYNCED,
2222
DEPLOYED,
2323
UPDATED_DESCENDANTS,
24-
STAGING_TREE_PUBLISHED,
24+
PUBLISHED_NEXT,
2525
])
2626

2727
# Client-side table constants

contentcuration/contentcuration/viewsets/sync/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from contentcuration.viewsets.sync.constants import PUBLISHED
1515
from contentcuration.viewsets.sync.constants import UPDATED
1616
from contentcuration.viewsets.sync.constants import UPDATED_DESCENDANTS
17-
from contentcuration.viewsets.sync.constants import STAGING_TREE_PUBLISHED
17+
from contentcuration.viewsets.sync.constants import PUBLISHED_NEXT
1818

1919

2020
def validate_table(table):
@@ -89,8 +89,8 @@ def generate_update_descendants_event(key, mods, channel_id=None, user_id=None):
8989
event["mods"] = mods
9090
return event
9191

92-
def generate_publish_staging_tree_event(key, version_notes="", language=None):
93-
event = _generate_event(key, CHANNEL, STAGING_TREE_PUBLISHED, key, None)
92+
def generate_publish_next_event(key, version_notes="", language=None):
93+
event = _generate_event(key, CHANNEL, PUBLISHED_NEXT, key, None)
9494
event["version_notes"] = version_notes
9595
event["language"] = language
9696
return event

0 commit comments

Comments
 (0)