Skip to content

Commit

Permalink
Merge pull request #76 from edly-io/tai/EDLY-6151
Browse files Browse the repository at this point in the history
Remove unique title for programs
  • Loading branch information
taimoor-ahmed-1 authored Nov 30, 2023
2 parents b8ae0c1 + a2e82dd commit 8bde8db
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 2.2.24 on 2023-10-24 09:56

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0018_auto_20200414_0739'),
('course_metadata', '0269_depr_program_card_image_url_and_add_exec_ed_cert_type'),
]

operations = [
migrations.AlterModelOptions(
name='program',
options={},
),
migrations.AlterField(
model_name='historicalprogram',
name='title',
field=models.CharField(help_text='The user-facing display title for this Program.', max_length=255),
),
migrations.AlterField(
model_name='program',
name='title',
field=models.CharField(help_text='The user-facing display title for this Program.', max_length=255),
),
migrations.AlterUniqueTogether(
name='program',
unique_together={('partner', 'title')},
),
]
7 changes: 6 additions & 1 deletion course_discovery/apps/course_metadata/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,7 @@ def __str__(self):
class Program(PkSearchableMixin, TimeStampedModel):
uuid = models.UUIDField(blank=True, default=uuid4, editable=False, unique=True, verbose_name=_('UUID'))
title = models.CharField(
help_text=_('The user-facing display title for this Program.'), max_length=255, unique=True)
help_text=_('The user-facing display title for this Program.'), max_length=255)
subtitle = models.CharField(
help_text=_('A brief, descriptive subtitle for the Program.'), max_length=255, blank=True)
marketing_hook = models.CharField(
Expand Down Expand Up @@ -2141,6 +2141,11 @@ class Program(PkSearchableMixin, TimeStampedModel):

history = HistoricalRecords()

class Meta:
unique_together = (
('partner', 'title'),
)

def __str__(self):
return self.title

Expand Down

0 comments on commit 8bde8db

Please sign in to comment.