summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2021-07-26 10:10:21 -0400
committerluxagraf <sng@luxagraf.net>2021-07-26 10:10:21 -0400
commitf94cd466d98eae940e2e9449aedc041ba9f6f431 (patch)
treefa2b0e072120e87460a48afaea06050e83c339aa /app
parentae46526a82d604174a33dd3dd9456aa8483cee80 (diff)
trad: fixed a bug in save new trades
Diffstat (limited to 'app')
-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()