-
Notifications
You must be signed in to change notification settings - Fork 256
Create ChannelVersion model with token support #5589
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
base: unstable
Are you sure you want to change the base?
Changes from 16 commits
e4a589d
66f50b7
31039f6
82dad0f
7743900
50f0355
64311a2
50398cf
17c9e4c
4819470
2573dcd
3339633
2a4e5ef
54867ca
4b73ac1
33e0391
e355fb1
9792dab
ca6856f
b213fd0
609e651
9c1fa51
a7c0245
458cc76
a3c2798
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -399,8 +399,7 @@ | |
| }); | ||
| const latestPublishedData = computed(() => { | ||
| if (!publishedData.value || !displayedVersion.value) return undefined; | ||
| return publishedData.value[displayedVersion.value]; | ||
| return publishedData.value; | ||
| }); | ||
|
||
| // Watch for when publishing completes - fetch publishedData to get the new version's data | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,293 @@ | ||
| # Generated by Django 3.2.24 on 2025-12-03 03:00 | ||
| import uuid | ||
|
|
||
| import django.contrib.postgres.fields | ||
| import django.db.models.deletion | ||
| from django.db import migrations | ||
| from django.db import models | ||
|
|
||
| import contentcuration.models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("contentcuration", "0159_update_community_library_submission_date_updated"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="ChannelVersion", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| contentcuration.models.UUIDField( | ||
| default=uuid.uuid4, | ||
| primary_key=True, | ||
| serialize=False, | ||
| ), | ||
| ), | ||
| ("version", models.PositiveIntegerField(blank=True, null=True)), | ||
| ("version_notes", models.TextField(blank=True, null=True)), | ||
| ("size", models.PositiveIntegerField(blank=True, null=True)), | ||
| ("date_published", models.DateTimeField(blank=True, null=True)), | ||
| ("resource_count", models.PositiveIntegerField(blank=True, null=True)), | ||
| ( | ||
| "kind_count", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.JSONField(), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| validators=[contentcuration.models.validate_kind_count_item], | ||
| ), | ||
| ), | ||
| ( | ||
| "included_licenses", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.IntegerField( | ||
| choices=[ | ||
| (1, "CC BY"), | ||
| (2, "CC BY-SA"), | ||
| (3, "CC BY-ND"), | ||
| (4, "CC BY-NC"), | ||
| (5, "CC BY-NC-SA"), | ||
| (6, "CC BY-NC-ND"), | ||
| (7, "All Rights Reserved"), | ||
| (8, "Public Domain"), | ||
| (9, "Special Permissions"), | ||
| ] | ||
| ), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| ), | ||
| ), | ||
| ( | ||
| "included_categories", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.CharField( | ||
| choices=[ | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.0t5msbL5", | ||
| "d&WXdXWF.qs0Xlaxq.0t5msbL5", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.ViBlbQR&", | ||
| "d&WXdXWF.K80UMYnW.ViBlbQR&", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.nG96nHDc", | ||
| "d&WXdXWF.qs0Xlaxq.nG96nHDc", | ||
| ), | ||
| ("d&WXdXWF.5QAjgfv7", "d&WXdXWF.5QAjgfv7"), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.mjSF4QlF", | ||
| "d&WXdXWF.i1IdaNwr.mjSF4QlF", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.uErN4PdS", | ||
| "d&WXdXWF.i1IdaNwr.uErN4PdS", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.8rJ57ht6", | ||
| "d&WXdXWF.qs0Xlaxq.8rJ57ht6", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.#r5ocgid", | ||
| "d&WXdXWF.i1IdaNwr.#r5ocgid", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.F863vKiF", | ||
| "d&WXdXWF.K80UMYnW.F863vKiF", | ||
| ), | ||
| ("d&WXdXWF.e#RTW9E#", "d&WXdXWF.e#RTW9E#"), | ||
| ("PbGoe2MV.J7CU1IxN", "PbGoe2MV.J7CU1IxN"), | ||
| ("PbGoe2MV", "PbGoe2MV"), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.BUMJJBnS", | ||
| "d&WXdXWF.5QAjgfv7.BUMJJBnS", | ||
| ), | ||
| ("BCG3&slG.wZ3EAedB", "BCG3&slG.wZ3EAedB"), | ||
| ("PbGoe2MV.EHcbjuKq", "PbGoe2MV.EHcbjuKq"), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.XsWznP4o", | ||
| "d&WXdXWF.5QAjgfv7.XsWznP4o", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.zbDzxDE7", | ||
| "d&WXdXWF.i1IdaNwr.zbDzxDE7", | ||
| ), | ||
| ("PbGoe2MV.kyxTNsRS", "PbGoe2MV.kyxTNsRS"), | ||
| ("PbGoe2MV.tS7WKnZ7", "PbGoe2MV.tS7WKnZ7"), | ||
| ("PbGoe2MV.HGIc9sZq", "PbGoe2MV.HGIc9sZq"), | ||
| ("ziJ6PCuU", "ziJ6PCuU"), | ||
| ("BCG3&slG", "BCG3&slG"), | ||
| ("BCG3&slG.0&d0qTqS", "BCG3&slG.0&d0qTqS"), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.lb7ELcK5", | ||
| "d&WXdXWF.qs0Xlaxq.lb7ELcK5", | ||
| ), | ||
| ("ziJ6PCuU.RLfhp37t", "ziJ6PCuU.RLfhp37t"), | ||
| ("d&WXdXWF.zWtcJ&F2", "d&WXdXWF.zWtcJ&F2"), | ||
| ( | ||
| "l7DsPDlm.ISEXeZt&.pRvOzJTE", | ||
| "l7DsPDlm.ISEXeZt&.pRvOzJTE", | ||
| ), | ||
| ("d&WXdXWF.JDUfJNXc", "d&WXdXWF.JDUfJNXc"), | ||
| ("BCG3&slG.fP2j70bj", "BCG3&slG.fP2j70bj"), | ||
| ("ziJ6PCuU.lOBPr5ix", "ziJ6PCuU.lOBPr5ix"), | ||
| ("BCG3&slG.HLo9TbNq", "BCG3&slG.HLo9TbNq"), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.DJLBbaEk", | ||
| "d&WXdXWF.kHKJ&PbV.DJLBbaEk", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.YMBXStib", | ||
| "d&WXdXWF.kHKJ&PbV.YMBXStib", | ||
| ), | ||
| ("d&WXdXWF.qs0Xlaxq", "d&WXdXWF.qs0Xlaxq"), | ||
| ( | ||
| "d&WXdXWF.e#RTW9E#.8ZoaPsVW", | ||
| "d&WXdXWF.e#RTW9E#.8ZoaPsVW", | ||
| ), | ||
| ("PbGoe2MV.UOTL#KIV", "PbGoe2MV.UOTL#KIV"), | ||
| ("PbGoe2MV.d8&gCo2N", "PbGoe2MV.d8&gCo2N"), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.u0aKjT4i", | ||
| "d&WXdXWF.5QAjgfv7.u0aKjT4i", | ||
| ), | ||
| ("BCG3&slG.Tsyej9ta", "BCG3&slG.Tsyej9ta"), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.r#wbt#jF", | ||
| "d&WXdXWF.i1IdaNwr.r#wbt#jF", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.K72&pITr", | ||
| "d&WXdXWF.K80UMYnW.K72&pITr", | ||
| ), | ||
| ("l7DsPDlm.#N2VymZo", "l7DsPDlm.#N2VymZo"), | ||
| ( | ||
| "d&WXdXWF.e#RTW9E#.CfnlTDZ#", | ||
| "d&WXdXWF.e#RTW9E#.CfnlTDZ#", | ||
| ), | ||
| ("PbGoe2MV.kivAZaeX", "PbGoe2MV.kivAZaeX"), | ||
| ("d&WXdXWF.kHKJ&PbV", "d&WXdXWF.kHKJ&PbV"), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.r7RxB#9t", | ||
| "d&WXdXWF.kHKJ&PbV.r7RxB#9t", | ||
| ), | ||
| ("d&WXdXWF", "d&WXdXWF"), | ||
| ("d&WXdXWF.i1IdaNwr", "d&WXdXWF.i1IdaNwr"), | ||
| ( | ||
| "l7DsPDlm.ISEXeZt&.&1WpYE&n", | ||
| "l7DsPDlm.ISEXeZt&.&1WpYE&n", | ||
| ), | ||
| ("d&WXdXWF.K80UMYnW", "d&WXdXWF.K80UMYnW"), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.75WBu1ZS", | ||
| "d&WXdXWF.K80UMYnW.75WBu1ZS", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.jNm15RLB", | ||
| "d&WXdXWF.qs0Xlaxq.jNm15RLB", | ||
| ), | ||
| ("l7DsPDlm.ISEXeZt&", "l7DsPDlm.ISEXeZt&"), | ||
| ( | ||
| "l7DsPDlm.ISEXeZt&.1JfIbP&N", | ||
| "l7DsPDlm.ISEXeZt&.1JfIbP&N", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.4LskOFXj", | ||
| "d&WXdXWF.5QAjgfv7.4LskOFXj", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.e#RTW9E#.P7s8FxQ8", | ||
| "d&WXdXWF.e#RTW9E#.P7s8FxQ8", | ||
| ), | ||
| ("l7DsPDlm", "l7DsPDlm"), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.KFJOCr&6", | ||
| "d&WXdXWF.kHKJ&PbV.KFJOCr&6", | ||
| ), | ||
| ], | ||
| max_length=100, | ||
| ), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| ), | ||
| ), | ||
| ( | ||
| "included_languages", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.CharField(max_length=100), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| validators=[contentcuration.models.validate_language_code], | ||
| ), | ||
| ), | ||
| ( | ||
| "non_distributable_licenses_included", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.IntegerField( | ||
| choices=[ | ||
| (1, "CC BY"), | ||
| (2, "CC BY-SA"), | ||
| (3, "CC BY-ND"), | ||
| (4, "CC BY-NC"), | ||
| (5, "CC BY-NC-SA"), | ||
| (6, "CC BY-NC-ND"), | ||
| (7, "All Rights Reserved"), | ||
| (8, "Public Domain"), | ||
| (9, "Special Permissions"), | ||
| ] | ||
| ), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| ), | ||
| ), | ||
| ( | ||
| "channel", | ||
| models.ForeignKey( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| related_name="channel_versions", | ||
| to="contentcuration.channel", | ||
| ), | ||
| ), | ||
| ( | ||
| "secret_token", | ||
| models.ForeignKey( | ||
| blank=True, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| to="contentcuration.secrettoken", | ||
| ), | ||
| ), | ||
| ( | ||
| "special_permissions_included", | ||
| models.ManyToManyField( | ||
| blank=True, | ||
| related_name="channel_versions", | ||
| to="contentcuration.AuditedSpecialPermissionsLicense", | ||
| ), | ||
| ), | ||
| ], | ||
| options={ | ||
| "unique_together": {("channel", "version")}, | ||
| }, | ||
| ), | ||
| migrations.AddField( | ||
| model_name="channel", | ||
| name="version_info", | ||
| field=models.OneToOneField( | ||
| blank=True, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| related_name="+", | ||
| to="contentcuration.channelversion", | ||
| ), | ||
| ), | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that we should also update this here to use the new info (since this would directly return the
latestPublishedDataobject).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, Thanks!