summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/importer.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimport/importer.go')
-rw-r--r--src/helsinki.at/rhimport/importer.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/helsinki.at/rhimport/importer.go b/src/helsinki.at/rhimport/importer.go
index 94065f6..afe422f 100644
--- a/src/helsinki.at/rhimport/importer.go
+++ b/src/helsinki.at/rhimport/importer.go
@@ -525,6 +525,7 @@ func is_cart_member_of_show(ctx *ImportContext, res *ImportResult, carts []uint)
}
res.ResponseCode = http.StatusBadRequest
res.ErrorString = fmt.Sprintf("Requested cart %d is not a member of show: %d", ctx.Cart, ctx.ShowId)
+ res.Cart = ctx.Cart
return false
}
@@ -609,8 +610,14 @@ func ImportFile(ctx *ImportContext) (res *ImportResult, err error) {
if err = clear_show_carts(ctx, res, show_carts); err != nil || (res.ResponseCode != http.StatusOK && res.ResponseCode != http.StatusNotFound) {
return
}
- if err = add_show_cart_cut(ctx, res, show_carts); err != nil || res.ResponseCode != http.StatusOK {
- return
+ if ctx.ClearCart && !ctx.ClearShowCarts {
+ if err = remove_add_cart_cut(ctx, res); err != nil || res.ResponseCode != http.StatusOK {
+ return
+ }
+ } else {
+ if err = add_show_cart_cut(ctx, res, show_carts); err != nil || res.ResponseCode != http.StatusOK {
+ return
+ }
}
rmCartOnErr = true
} else if ctx.GroupName != "" {