From 5398d24b3249656f1ef39beb29c33cf47532f801 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 12 May 2021 18:05:21 +0200 Subject: [PATCH] Event copy: Fix suspicious file operation --- src/pretix/base/models/event.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/base/models/event.py b/src/pretix/base/models/event.py index e552a351f6..192b8940c0 100644 --- a/src/pretix/base/models/event.py +++ b/src/pretix/base/models/event.py @@ -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 os import string import uuid from collections import OrderedDict @@ -675,7 +675,7 @@ class Event(EventMixin, LoggedModel): i.pk = None i.event = self if i.picture: - i.picture.save(i.picture.name, i.picture) + i.picture.save(os.path.basename(i.picture.name), i.picture) if i.category_id: i.category = category_map[i.category_id] if i.tax_rule_id: