diff --git a/AKSubmission/forms.py b/AKSubmission/forms.py index 3bf2bd645f84e702ecf29170b35a7b94dc9d64f2..57b94341cd76f34ec6e06c28622c5df3579d43d2 100644 --- a/AKSubmission/forms.py +++ b/AKSubmission/forms.py @@ -72,7 +72,11 @@ class AKForm(forms.ModelForm): # Generate short name if not given short_name = self.cleaned_data["short_name"] if len(short_name) == 0: - cleaned_data["short_name"] = ''.join(x for x in self.cleaned_data["name"].title() if x.isalnum()) + short_name = self.cleaned_data['name'] + short_name = short_name.partition(':')[0] + short_name = short_name.partition(' - ')[0] + short_name = short_name.partition(' (')[0] + cleaned_data["short_name"] = short_name[:AK._meta.get_field('short_name').max_length] # Get tag names from raw tags cleaned_data["tag_names"] = [name.strip().lower() for name in cleaned_data["tags_raw"].split(";")]