diff --git a/arkindex/documents/migrations/0045_alter_element_rotation_angle.py b/arkindex/documents/migrations/0045_alter_element_rotation_angle.py new file mode 100644 index 0000000000000000000000000000000000000000..230d026eb348c4407e3f0e3fdd7f3a777d5aec27 --- /dev/null +++ b/arkindex/documents/migrations/0045_alter_element_rotation_angle.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.3 on 2021-11-03 09:27 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('documents', '0044_remove_metadata_index'), + ] + + operations = [ + migrations.AlterField( + model_name='element', + name='rotation_angle', + field=models.SmallIntegerField(default=0, help_text='Clockwise rotation to apply to the image after cropping, in degrees.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(359)]), + ), + ] diff --git a/arkindex/documents/models.py b/arkindex/documents/models.py index a1c0a4d28beddae5548505b8818cc5c484ea8d08..c497296680d468ac87aabe168e2b923bc5e2afcb 100644 --- a/arkindex/documents/models.py +++ b/arkindex/documents/models.py @@ -164,7 +164,7 @@ class Element(IndexableModel): polygon = LinearRingField(srid=0, null=True, blank=True) rotation_angle = models.SmallIntegerField( - validators=[MaxValueValidator(359)], + validators=[MinValueValidator(0), MaxValueValidator(359)], default=0, help_text='Clockwise rotation to apply to the image after cropping, in degrees.', )