summaryrefslogtreecommitdiff
path: root/app/trading/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/trading/models.py')
-rw-r--r--app/trading/models.py3
1 files changed, 2 insertions, 1 deletions
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()