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

Project.cmake: dont stop on wrong stuff

parent 52a350cf
...@@ -6,6 +6,7 @@ from subprocess import check_output ...@@ -6,6 +6,7 @@ from subprocess import check_output
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from django.db.models.functions import Length from django.db.models.functions import Length
from django.db.utils import DataError
from django.template.loader import get_template from django.template.loader import get_template
from django.utils.dateparse import parse_datetime from django.utils.dateparse import parse_datetime
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
...@@ -217,8 +218,11 @@ class Project(Links, NamedModel, TimeStampedModel): ...@@ -217,8 +218,11 @@ class Project(Links, NamedModel, TimeStampedModel):
for key, value in CMAKE_FIELDS.items(): for key, value in CMAKE_FIELDS.items():
search = re.search(f'set\s*\(\s*project_{key}\s+([^)]+)*\)', content, re.I) search = re.search(f'set\s*\(\s*project_{key}\s+([^)]+)*\)', content, re.I)
if search: if search:
try:
self.__dict__[value] = search.groups()[0].strip(''' \r\n\t'"''') self.__dict__[value] = search.groups()[0].strip(''' \r\n\t'"''')
self.save() self.save()
except DataError:
pass
for dependency in re.findall(r'ADD_[^ ]+_DEPENDENCY\s*\(["\']([^ ]+).*["\']\)', content, re.I): for dependency in re.findall(r'ADD_[^ ]+_DEPENDENCY\s*\(["\']([^ ]+).*["\']\)', content, re.I):
project = Project.objects.filter(slug=dependency) project = Project.objects.filter(slug=dependency)
if project.exists(): if project.exists():
......
Supports Markdown
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