Skip to content

Commit

Permalink
Merge pull request #350 from fao89/7353
Browse files Browse the repository at this point in the history
Replace URLField with CharField
  • Loading branch information
fao89 committed Aug 28, 2020
2 parents 8e4168d + 8eeeeda commit b3695fa
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES/7353.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace URLField with CharField
33 changes: 33 additions & 0 deletions pulp_ansible/app/migrations/0022_URLField_to_CharField.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 2.2.15 on 2020-08-27 21:37

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('ansible', '0021_rename_role_remote'),
]

operations = [
migrations.AlterField(
model_name='collectionversion',
name='documentation',
field=models.CharField(blank=True, default='', editable=False, max_length=2000),
),
migrations.AlterField(
model_name='collectionversion',
name='homepage',
field=models.CharField(blank=True, default='', editable=False, max_length=2000),
),
migrations.AlterField(
model_name='collectionversion',
name='issues',
field=models.CharField(blank=True, default='', editable=False, max_length=2000),
),
migrations.AlterField(
model_name='collectionversion',
name='repository',
field=models.CharField(blank=True, default='', editable=False, max_length=2000),
),
]
16 changes: 8 additions & 8 deletions pulp_ansible/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ class CollectionVersion(Content):
description (models.TextField): A short summary description of the collection.
docs_blob (psql_fields.JSONField): A JSON field holding the various documentation blobs in
the collection.
documentation (models.URLField): The URL to any online docs.
homepage (models.URLField): The URL to the homepage of the collection/project.
issues (models.URLField): The URL to the collection issue tracker.
documentation (models.CharField): The URL to any online docs.
homepage (models.CharField): The URL to the homepage of the collection/project.
issues (models.CharField): The URL to the collection issue tracker.
license (psql_fields.ArrayField): A list of licenses for content inside of a collection.
name (models.CharField): The name of the collection.
namespace (models.CharField): The namespace of the collection.
repository (models.URLField): The URL of the originating SCM repository.
repository (models.CharField): The URL of the originating SCM repository.
version (models.CharField): The version of the collection.
is_highest (models.BooleanField): Indicates that the version is the highest one
in the collection.
Expand All @@ -140,13 +140,13 @@ class CollectionVersion(Content):
dependencies = psql_fields.JSONField(default=dict, editable=False)
description = models.TextField(default="", blank=True, editable=False)
docs_blob = psql_fields.JSONField(default=dict, editable=False)
documentation = models.URLField(default="", blank=True, max_length=2000, editable=False)
homepage = models.URLField(default="", blank=True, max_length=2000, editable=False)
issues = models.URLField(default="", blank=True, max_length=2000, editable=False)
documentation = models.CharField(default="", blank=True, max_length=2000, editable=False)
homepage = models.CharField(default="", blank=True, max_length=2000, editable=False)
issues = models.CharField(default="", blank=True, max_length=2000, editable=False)
license = psql_fields.ArrayField(models.CharField(max_length=32), default=list, editable=False)
name = models.CharField(max_length=64, editable=False)
namespace = models.CharField(max_length=32, editable=False)
repository = models.URLField(default="", blank=True, max_length=2000, editable=False)
repository = models.CharField(default="", blank=True, max_length=2000, editable=False)
version = models.CharField(max_length=32, editable=False)

is_highest = models.BooleanField(editable=False, default=False)
Expand Down
8 changes: 4 additions & 4 deletions pulp_ansible/app/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,17 @@ class CollectionVersionSerializer(SingleArtifactContentSerializer, ContentChecks
help_text=_("A JSON field holding the various documentation blobs in the collection.")
)

documentation = serializers.URLField(
documentation = serializers.CharField(
help_text=_("The URL to any online docs."), allow_blank=True, max_length=2000
)

homepage = serializers.URLField(
homepage = serializers.CharField(
help_text=_("The URL to the homepage of the collection/project."),
allow_blank=True,
max_length=2000,
)

issues = serializers.URLField(
issues = serializers.CharField(
help_text=_("The URL to the collection issue tracker."), allow_blank=True, max_length=2000
)

Expand All @@ -312,7 +312,7 @@ class CollectionVersionSerializer(SingleArtifactContentSerializer, ContentChecks
help_text=_("The namespace of the collection."), max_length=32
)

repository = serializers.URLField(
repository = serializers.CharField(
help_text=_("The URL of the originating SCM repository."), allow_blank=True, max_length=2000
)

Expand Down

0 comments on commit b3695fa

Please sign in to comment.