Commit c3096d9b authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

projects name should not have underscores

parent db719b98
Pipeline #1747 passed with stages
in 54 seconds
......@@ -11,9 +11,8 @@ from django.template.loader import get_template
from django.utils.dateparse import parse_datetime
from django.utils.safestring import mark_safe
import requests
import git
import requests
from autoslug import AutoSlugField
from ndh.models import Links, NamedModel, TimeStampedModel
from ndh.utils import enum_to_choices, query_sum
......@@ -251,7 +250,7 @@ class Project(Links, NamedModel, TimeStampedModel):
if search:
try:
old = getattr(self, value)
new = search.groups()[0].strip(''' \r\n\t'"''')
new = search.groups()[0].strip(''' \r\n\t'"''').replace('_', '-')
if old != new:
setattr(self, value, new)
self.save()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment