Validate URLs before adding
This commit is contained in:
parent
6f544db209
commit
c41780fca0
12 changed files with 386 additions and 16 deletions
25
feeds/migrations/0002_blocklist.py
Normal file
25
feeds/migrations/0002_blocklist.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Generated by Django 5.0.1 on 2024-01-30 16:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('feeds', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Blocklist',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('url', models.URLField(help_text='The URL to block.', unique=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Blocklist',
|
||||
'verbose_name_plural': 'Blocklists',
|
||||
'db_table_comment': 'A list of URLs to block.',
|
||||
},
|
||||
),
|
||||
]
|
||||
18
feeds/migrations/0003_blocklist_active.py
Normal file
18
feeds/migrations/0003_blocklist_active.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.0.1 on 2024-01-30 16:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('feeds', '0002_blocklist'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='blocklist',
|
||||
name='active',
|
||||
field=models.BooleanField(default=True, help_text='Is this URL still blocked?'),
|
||||
),
|
||||
]
|
||||
18
feeds/migrations/0004_alter_blocklist_url.py
Normal file
18
feeds/migrations/0004_alter_blocklist_url.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.0.1 on 2024-01-30 18:22
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('feeds', '0003_blocklist_active'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='blocklist',
|
||||
name='url',
|
||||
field=models.CharField(help_text='The URL to block.', max_length=2000, unique=True),
|
||||
),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue