Skip to content

Commit ec377d2

Browse files
committed
Save a CfbotBranch with NULL commit_id instead of empty string
This is only really useful when saving the entry from the admin panel.
1 parent d4b17ce commit ec377d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pgcommitfest/commitfest/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ class CfbotBranch(models.Model):
381381
created = models.DateTimeField(auto_now_add=True)
382382
modified = models.DateTimeField(auto_now=True)
383383

384+
def save(self, *args, **kwargs):
385+
if not self.commit_id:
386+
self.commit_id = None
387+
super(CfbotBranch, self).save(*args, **kwargs)
388+
384389

385390
class CfbotTask(models.Model):
386391
STATUS_CHOICES = [

0 commit comments

Comments
 (0)