Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Merge 18d4adb into 9c3a9b6
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney authored Apr 1, 2021
2 parents 9c3a9b6 + 18d4adb commit 1bed7b8
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- run: |
./manage.py migrate
./manage.py makemigrations --check --dry-run
./manage.py check --fail-level WARNING
./manage.py loaddata country redflag equitycategory equitykeywords
coverage run --source content,country,covidadmin,vizualization,country/management/commands manage.py test
env:
Expand Down
45 changes: 45 additions & 0 deletions content/migrations/0046_auto_20210401_0016.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Generated by Django 3.1.7 on 2021-04-01 00:16

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('country', '0030_auto_20210331_1526'),
('content', '0045_auto_20210331_1526'),
]

operations = [
migrations.AlterField(
model_name='dataimport',
name='country',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='country.country'),
),
migrations.AlterField(
model_name='insightspage',
name='language',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='country.language'),
),
migrations.AlterField(
model_name='insightspage',
name='topics',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='country.topic'),
),
migrations.AlterField(
model_name='resourcespage',
name='lang',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='country.language'),
),
migrations.AlterField(
model_name='resourcespage',
name='topics',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='country.topic'),
),
migrations.AlterField(
model_name='staticpage',
name='language',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='country.language'),
),
]
12 changes: 6 additions & 6 deletions content/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def rendered_body(self):
tags = ClusterTaggableManager(through="content.InsightPageTag", blank=True)
news_date = models.DateField("Published date", default=now)

language = models.ForeignKey(Language, on_delete=models.CASCADE, blank=False, null=False)
topics = models.ForeignKey(Topic, on_delete=models.CASCADE, blank=True, null=True)
language = models.ForeignKey(Language, on_delete=models.PROTECT, blank=False, null=False)
topics = models.ForeignKey(Topic, on_delete=models.SET_NULL, blank=True, null=True)

content_panels = Page.content_panels + [
FieldPanel("contents_type"),
Expand Down Expand Up @@ -188,9 +188,9 @@ def rendered_description(self):
link = models.URLField(max_length=10000, null=True, blank=True)

language = models.CharField(max_length=2000, null=True, blank=True)
lang = models.ForeignKey(Language, on_delete=models.CASCADE, blank=False, null=False)
lang = models.ForeignKey(Language, on_delete=models.PROTECT, blank=False, null=False)
topic = models.CharField(max_length=2000, null=True, blank=True)
topics = models.ForeignKey(Topic, on_delete=models.CASCADE, blank=True, null=True)
topics = models.ForeignKey(Topic, on_delete=models.SET_NULL, blank=True, null=True)

published_date = models.DateField("Published date")
author = models.CharField(blank=True, max_length=250)
Expand Down Expand Up @@ -250,7 +250,7 @@ class DataImport(Page):

import_file = models.FileField(null=True, blank=False, upload_to="documents", validators=[validate_file_extension])

country = models.ForeignKey(Country, on_delete=models.CASCADE, blank=False, null=False)
country = models.ForeignKey(Country, on_delete=models.PROTECT, blank=False, null=False)
validated = models.BooleanField(null=False, blank=True, default=False)
no_of_rows = models.CharField(verbose_name=_("No of rows"), null=True, max_length=10, default=0)
imported = models.BooleanField(null=False, blank=True, default=False)
Expand Down Expand Up @@ -284,7 +284,7 @@ class StaticPage(Page):

subpage_types = []

language = models.ForeignKey(Language, on_delete=models.CASCADE, blank=False, null=False)
language = models.ForeignKey(Language, on_delete=models.PROTECT, blank=False, null=False)
body = RichTextField()
PAGE_TYPE_OPTIONS = (
("static_page", "Static Page"),
Expand Down

0 comments on commit 1bed7b8

Please sign in to comment.