Section 3-8 - #MIgration Runs -
Multiple Migfeat: Update publishing terminology and add publishing settings - Changed references from "WordPress" to "Site" across multiple components for consistency. - Introduced a new "Publishing" tab in Site Settings to manage automatic content approval and publishing behavior. - Added publishing settings model to the backend with fields for auto-approval, auto-publish, and publishing limits. - Implemented Celery tasks for scheduling and processing automated content publishing. - Enhanced Writer Dashboard to include metrics for content published to the site and scheduled for publishing.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# Generated migration for publishing scheduler fields
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('writer', '0014_add_approved_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='content',
|
||||
name='site_status',
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
('not_published', 'Not Published'),
|
||||
('scheduled', 'Scheduled'),
|
||||
('publishing', 'Publishing'),
|
||||
('published', 'Published'),
|
||||
('failed', 'Failed'),
|
||||
],
|
||||
db_index=True,
|
||||
default='not_published',
|
||||
help_text='External site publishing status',
|
||||
max_length=50,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='content',
|
||||
name='scheduled_publish_at',
|
||||
field=models.DateTimeField(
|
||||
blank=True,
|
||||
db_index=True,
|
||||
help_text='Scheduled time for publishing to external site',
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='content',
|
||||
name='site_status_updated_at',
|
||||
field=models.DateTimeField(
|
||||
blank=True,
|
||||
help_text='Last time site_status was changed',
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -186,6 +186,9 @@ class ContentSerializer(serializers.ModelSerializer):
|
||||
'external_url',
|
||||
'source',
|
||||
'status',
|
||||
'site_status',
|
||||
'scheduled_publish_at',
|
||||
'site_status_updated_at',
|
||||
'word_count',
|
||||
'sector_name',
|
||||
'site_id',
|
||||
@@ -197,7 +200,7 @@ class ContentSerializer(serializers.ModelSerializer):
|
||||
'created_at',
|
||||
'updated_at',
|
||||
]
|
||||
read_only_fields = ['id', 'created_at', 'updated_at', 'account_id']
|
||||
read_only_fields = ['id', 'created_at', 'updated_at', 'account_id', 'site_status', 'scheduled_publish_at', 'site_status_updated_at']
|
||||
|
||||
def validate(self, attrs):
|
||||
"""Ensure required fields for Content creation"""
|
||||
|
||||
Reference in New Issue
Block a user