Skip to content
Snippets Groups Projects
Commit 4b3709d8 authored by Valentin Groues's avatar Valentin Groues :eyes:
Browse files

prefix field can be blank for locations - #96

parent a82d785c
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -84,7 +84,7 @@ class SubjectAddForm(ModelForm):
def get_prefix_screening_number(self):
default_location = self.cleaned_data.get('default_location', None)
screening_number_prefix = None
if default_location is not None and default_location.prefix is not None:
if default_location is not None and default_location.prefix:
screening_number_prefix = default_location.prefix
else:
subject_type = self.cleaned_data.get('type', None)
......
......@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='location',
name='prefix',
field=models.CharField(max_length=1, null=True),
field=models.CharField(max_length=1, blank=True),
),
migrations.RunPython(add_prefixes, reverse_code=lambda x, y: None),
......
......@@ -13,7 +13,7 @@ class Location(models.Model):
blank=True,
default="")
prefix = models.CharField(max_length=1, null=True)
prefix = models.CharField(max_length=1, blank=True)
def __str__(self):
return "%s" % self.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment