From f94cd466d98eae940e2e9449aedc041ba9f6f431 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 26 Jul 2021 10:10:21 -0400 Subject: trad: fixed a bug in save new trades --- app/trading/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/trading') diff --git a/app/trading/models.py b/app/trading/models.py index 63febc2..c030e05 100644 --- a/app/trading/models.py +++ b/app/trading/models.py @@ -182,7 +182,8 @@ class LuxTrade(models.Model): self.close_date = timezone.now() if self.status == 1 and not self.pl: self.pl = round((self.close_price*self.shares)-(self.entry_price*self.shares), 2) - self.notes_html = markdown_to_html(self.notes) + if self.notes: + self.notes_html = markdown_to_html(self.notes) super(LuxTrade, self).save() -- cgit v1.2.3-70-g09d2