Commit d4e7dea4 authored by Julia Anishka's avatar Julia Anishka

fixed error in line 21 of models.py

parent 182c058c
# Generated by Django 3.2 on 2023-03-27 12:27
import bookshelf.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookshelf', '0002_alter_books_blurb'),
]
operations = [
migrations.AlterField(
model_name='books',
name='blurb',
field=models.TextField(validators=[bookshelf.models.verify_wordCount]),
),
]
...@@ -18,7 +18,7 @@ def verify_int(value): ...@@ -18,7 +18,7 @@ def verify_int(value):
raise ValidationError('ISBN must only be integers.') raise ValidationError('ISBN must only be integers.')
def verify_wordCount(value): def verify_wordCount(value):
word_count = len(value.split()) word_count = str(len(value.split()))
if word_count < 100: if word_count < 100:
raise ValidationError('Word count is less than 100. Required range is 100 to 200 words.') raise ValidationError('Word count is less than 100. Required range is 100 to 200 words.')
if word_count > 200: if word_count > 200:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment