From 55fa52148647799af8b0edebc85e35147987210a Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 30 Jun 2022 08:29:57 +0200 Subject: [PATCH] Increase target url allowed size --- .pre-commit-config.yaml | 16 ++++++++-------- .../0006_alter_redirect_target_url.py | 18 ++++++++++++++++++ src/redirect/models.py | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 src/redirect/migrations/0006_alter_redirect_target_url.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be3474e..2a51c42 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ exclude: \.min\.(js|css)(\.map)?$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.3.0 hooks: - id: check-ast - id: check-json @@ -24,26 +24,26 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 22.6.0 hooks: - id: black - repo: https://github.com/asottile/pyupgrade - rev: v2.31.1 + rev: v2.34.0 hooks: - id: pyupgrade args: - --py310-plus - repo: https://github.com/adamchainz/django-upgrade - rev: 1.4.0 + rev: 1.7.0 hooks: - id: django-upgrade args: [--target-version, "4.0"] - repo: https://github.com/rtts/djhtml - rev: v1.5.0 + rev: v1.5.1 hooks: - id: djhtml - repo: https://github.com/flakeheaven/flakeheaven - rev: 0.11.0 + rev: 2.0.0 hooks: - id: flakeheaven additional_dependencies: @@ -57,12 +57,12 @@ repos: - flake8-noqa - pep8-naming - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.6.1 + rev: v2.7.1 hooks: - id: prettier types_or: [javascript, css] - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.11.0 + rev: v8.18.0 hooks: - id: eslint types_or: [javascript, css] diff --git a/src/redirect/migrations/0006_alter_redirect_target_url.py b/src/redirect/migrations/0006_alter_redirect_target_url.py new file mode 100644 index 0000000..64768c7 --- /dev/null +++ b/src/redirect/migrations/0006_alter_redirect_target_url.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.11 on 2022-06-30 06:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("redirect", "0005_auto_20220227_2307"), + ] + + operations = [ + migrations.AlterField( + model_name="redirect", + name="target_url", + field=models.URLField(max_length=50000), + ), + ] diff --git a/src/redirect/models.py b/src/redirect/models.py index fadb1b7..6efebe4 100644 --- a/src/redirect/models.py +++ b/src/redirect/models.py @@ -6,7 +6,7 @@ from django.urls import reverse class Redirect(models.Model): short_code = models.CharField(max_length=250, blank=False, null=False, unique=True) - target_url = models.URLField(max_length=2000) + target_url = models.URLField(max_length=50_000) owner = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.SET_NULL,