Browse Source

Correct initialisation of stockrecord form

Fixes #336
master
David Winterbottom 13 years ago
parent
commit
d9a7029a00
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      oscar/apps/dashboard/catalogue/views.py

+ 3
- 4
oscar/apps/dashboard/catalogue/views.py View File

208
         stock record it will be passed into the form as
208
         stock record it will be passed into the form as
209
         ``instance``.
209
         ``instance``.
210
         """
210
         """
211
-        if not self.is_stockrecord_submitted():
212
-            return StockRecordForm(self.object.product_class)
213
-
214
         stockrecord = None
211
         stockrecord = None
215
         if self.object.has_stockrecord:
212
         if self.object.has_stockrecord:
216
             stockrecord = self.object.stockrecord
213
             stockrecord = self.object.stockrecord
217
-
214
+        if not self.is_stockrecord_submitted():
215
+            return StockRecordForm(self.object.product_class,
216
+                                   instance=stockrecord)
218
         return StockRecordForm(
217
         return StockRecordForm(
219
             self.object.product_class,
218
             self.object.product_class,
220
             self.request.POST,
219
             self.request.POST,

Loading…
Cancel
Save