mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Add-on selection: Fix incorrect pre-selection across multiple base positions
This commit is contained in:
@@ -513,7 +513,11 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
|
||||
)
|
||||
item_cache[ckey] = items
|
||||
else:
|
||||
items = item_cache[ckey]
|
||||
# We can use the cache to prevent a database fetch, but we need separate Python objects
|
||||
# or our things below like setting `i.initial` will do the wrong thing.
|
||||
items = [copy.copy(i) for i in item_cache[ckey]]
|
||||
for i in items:
|
||||
i.available_variations = [copy.copy(v) for v in i.available_variations]
|
||||
|
||||
for i in items:
|
||||
i.allow_waitinglist = False
|
||||
|
||||
@@ -82,12 +82,12 @@
|
||||
<tr>
|
||||
<td>
|
||||
{% if op.variation %}
|
||||
{% blocktrans trimmed with positionid=op.position.positionid item=op.item.name variation=op.variation.value %}
|
||||
Add position #{{ positionid }} ({{ item }} – {{ variation }})
|
||||
{% blocktrans trimmed with item=op.item.name variation=op.variation.value %}
|
||||
Add position ({{ item }} – {{ variation }})
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with positionid=op.position.positionid item=op.item.name %}
|
||||
Add position #{{ positionid }} ({{ item }})
|
||||
{% blocktrans trimmed with item=op.item.name %}
|
||||
Add position ({{ item }})
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% if op.addon_to %}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
# Unless required by applicable law or agreed to in writing, software distributed under the Apache License 2.0 is
|
||||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
import copy
|
||||
import inspect
|
||||
import json
|
||||
import mimetypes
|
||||
@@ -1242,7 +1242,11 @@ class OrderChange(EventViewMixin, OrderDetailMixin, TemplateView):
|
||||
)
|
||||
item_cache[ckey] = items
|
||||
else:
|
||||
items = item_cache[ckey]
|
||||
# We can use the cache to prevent a database fetch, but we need separate Python objects
|
||||
# or our things below like setting `i.initial` will do the wrong thing.
|
||||
items = [copy.copy(i) for i in item_cache[ckey]]
|
||||
for i in items:
|
||||
i.available_variations = [copy.copy(v) for v in i.available_variations]
|
||||
|
||||
for i in items:
|
||||
i.allow_waitinglist = False
|
||||
|
||||
Reference in New Issue
Block a user