mirror of
https://github.com/Findus23/acronomy.git
synced 2024-09-12 07:33:45 +02:00
allow excluding checks
This commit is contained in:
parent
af06df7c7d
commit
353d51fefd
3 changed files with 25 additions and 1 deletions
23
acros/migrations/0050_auto_20210308_1855.py
Normal file
23
acros/migrations/0050_auto_20210308_1855.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-08 18:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('acros', '0049_auto_20200727_1902'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='acronym',
|
||||
name='ignore_in_checks',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='historicalacronym',
|
||||
name='ignore_in_checks',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -30,6 +30,7 @@ class Acronym(models.Model):
|
|||
created_date = models.DateTimeField(auto_now_add=True)
|
||||
modified_date = models.DateTimeField(auto_now=True)
|
||||
pageviews = models.IntegerField(default=0, editable=False)
|
||||
ignore_in_checks = models.BooleanField(default=False)
|
||||
|
||||
def clean(self):
|
||||
if not self.slug:
|
||||
|
|
|
@ -11,7 +11,7 @@ greek_letters = set([c for c in greek_symbols if c.isalpha()])
|
|||
|
||||
class LetterCheck(BaseCheck):
|
||||
def run(self):
|
||||
for acronym in Acronym.objects.all():
|
||||
for acronym in Acronym.objects.filter(ignore_in_checks=False):
|
||||
if acronym.acro_letters is None:
|
||||
yield CheckInfo(
|
||||
"missing acronym letters",
|
||||
|
|
Loading…
Reference in a new issue