Skip to content

Commit

Permalink
allow null for different source line numbers
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed May 20, 2021
1 parent 175539e commit 250f3ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion spackmon/apps/main/logparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@ def parse_build_logs(build):
post_context="\n".join(warning.post_context),
)
for error in errors:
try:
source_line_no = error.source_line_no[0]
except:
source_line_no = None
log = BE.objects.create(
phase=phase,
source_file=error.source_file,
source_line_no=error.source_line_no,
source_line_no=source_line_no,
line_no=error.line_no,
repeat_count=error.repeat_count,
start=error.start,
Expand Down
8 changes: 4 additions & 4 deletions spackmon/apps/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class BuildEvent(BaseModel):
source_file = models.CharField(
max_length=150, blank=False, null=False, help_text="The source file."
)
source_line_no = models.PositiveIntegerField(default=None)
line_no = models.PositiveIntegerField(default=None)
source_line_no = models.PositiveIntegerField(default=None, blank=True, null=True)
line_no = models.PositiveIntegerField(default=None, blank=True, null=True)
repeat_count = models.PositiveIntegerField(default=0)
start = models.PositiveIntegerField(default=None)
end = models.PositiveIntegerField(default=None)
start = models.PositiveIntegerField(default=None, blank=True, null=True)
end = models.PositiveIntegerField(default=None, blank=True, null=True)
text = models.TextField()
pre_context = models.TextField()
post_context = models.TextField()
Expand Down

0 comments on commit 250f3ed

Please sign in to comment.