Commit e204b8e1 authored by Michal Čihař's avatar Michal Čihař

Do not store change object for not yet saved subproject

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent f6444bef
...@@ -828,6 +828,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin): ...@@ -828,6 +828,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
'%s remote into repo', '%s remote into repo',
self.merge_style, self.merge_style,
) )
if self.id:
Change.objects.create( Change.objects.create(
subproject=self, subproject=self,
user=request.user if request else None, user=request.user if request else None,
...@@ -849,6 +850,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin): ...@@ -849,6 +850,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
# Reset repo back # Reset repo back
method(abort=True) method(abort=True)
if self.id:
Change.objects.create( Change.objects.create(
subproject=self, subproject=self,
user=request.user if request else None, user=request.user if request else None,
......
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