Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Protect foreign key constraint between imagelist_images and `imagel…
Browse files Browse the repository at this point in the history
…ist` (#356)
  • Loading branch information
dhruvkb authored Nov 17, 2021

Unverified

This user has not yet uploaded their public signing key.
1 parent bd1d9d1 commit e0949d2
Showing 4 changed files with 5 additions and 21 deletions.
4 changes: 3 additions & 1 deletion ingestion_server/test/unit_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import datetime
from unittest.mock import MagicMock
from uuid import uuid4

from psycopg2.extras import Json

from ingestion_server.cleanup import CleanupFunctions
from ingestion_server.cleanup import CleanupFunctions, TlsTest
from ingestion_server.elasticsearch_models import Image


@@ -141,6 +142,7 @@ def test_url_protocol_fix():
expected = "'https://flickr.com'"

bad_http = "neverssl.com"
TlsTest.test_tls_supported = MagicMock(return_value=False)
result_http = CleanupFunctions.cleanup_url(bad_http, tls_support_cache)
expected_http = "'http://neverssl.com'"
assert result == expected
2 changes: 1 addition & 1 deletion openverse_api/catalog/api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ class Migration(migrations.Migration):
fields=[
('created_on', models.DateTimeField(auto_now_add=True)),
('updated_on', models.DateTimeField(auto_now=True)),
('id', models.IntegerField(primary_key=True, serialize=False)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(help_text='Display name', max_length=2000)),
('images', models.ManyToManyField(help_text='A list of primary keys corresponding to images.', related_name='lists', to='api.Image')),
],
18 changes: 0 additions & 18 deletions openverse_api/catalog/api/migrations/0002_auto_20180723_1737.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('api', '0002_auto_20180723_1737'),
('api', '0001_initial'), # 0002 was merged into 0001 to protect FK constraint
]

operations = [

0 comments on commit e0949d2

Please sign in to comment.