This commit is contained in:
Aevann1 2022-02-27 23:57:44 +02:00
parent d62fffe294
commit b1f996f0b6
10 changed files with 83 additions and 111 deletions

View file

@ -214,11 +214,10 @@ class Submission(Base):
if self.club: return link + '/-'
output = self.title.lower()
output = re.sub('&\w{2,3};', '', output, flags=re.A)
output = [re.sub('\W', '', word, flags=re.A) for word in output.split()]
output = [x for x in output if x][:6]
output = title_regex.sub('', self.title.lower())
output = output.split()[:6]
output = '-'.join(output)
if not output: output = '-'
return f"{link}/{output}"