diff --git a/AKSubmission/forms.py b/AKSubmission/forms.py index 45551e48513f865ef8f68679ef257273e516f3a1..bddf28578bb02ac0ce92768c07f2508d8b4d3650 100644 --- a/AKSubmission/forms.py +++ b/AKSubmission/forms.py @@ -78,15 +78,13 @@ class AKForm(forms.ModelForm): short_name = short_name.partition(':')[0] short_name = short_name.partition(' - ')[0] short_name = short_name.partition(' (')[0] + short_name = short_name[:AK._meta.get_field('short_name').max_length] for i in itertools.count(1): if not AK.objects.filter(short_name=short_name, event=self.cleaned_data["event"]).exists(): break - print(short_name) digits = len(str(i)) - print(digits) short_name = '{}-{}'.format(short_name[:-(digits + 1)], i) - print(short_name) - cleaned_data["short_name"] = short_name[:AK._meta.get_field('short_name').max_length] + cleaned_data["short_name"] = short_name # Get tag names from raw tags cleaned_data["tag_names"] = [name.strip().lower() for name in cleaned_data["tags_raw"].split(";")]