forked from CGM_Public/pretix_original
Fix more Python 3.12 warnings
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
# License for the specific language governing permissions and limitations under the License.
|
# License for the specific language governing permissions and limitations under the License.
|
||||||
import copy
|
import copy
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import datetime, timedelta
|
from datetime import UTC, datetime, timedelta
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
@@ -493,7 +493,7 @@ def iframe_entry_view_wrapper(view_func):
|
|||||||
settings.LANGUAGE_COOKIE_NAME,
|
settings.LANGUAGE_COOKIE_NAME,
|
||||||
locale,
|
locale,
|
||||||
max_age=max_age,
|
max_age=max_age,
|
||||||
expires=(datetime.utcnow() + timedelta(seconds=max_age)).strftime('%a, %d-%b-%Y %H:%M:%S GMT'),
|
expires=(datetime.now(UTC) + timedelta(seconds=max_age)).strftime('%a, %d-%b-%Y %H:%M:%S GMT'),
|
||||||
)
|
)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# 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.
|
# License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import UTC, datetime, timedelta
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
@@ -60,7 +60,7 @@ class LocaleSet(NoSearchIndexViewMixin, View):
|
|||||||
settings.LANGUAGE_COOKIE_NAME,
|
settings.LANGUAGE_COOKIE_NAME,
|
||||||
locale,
|
locale,
|
||||||
max_age=max_age,
|
max_age=max_age,
|
||||||
expires=(datetime.utcnow() + timedelta(seconds=max_age)).strftime(
|
expires=(datetime.now(UTC) + timedelta(seconds=max_age)).strftime(
|
||||||
'%a, %d-%b-%Y %H:%M:%S GMT'),
|
'%a, %d-%b-%Y %H:%M:%S GMT'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ filterwarnings =
|
|||||||
ignore::DeprecationWarning:cgi
|
ignore::DeprecationWarning:cgi
|
||||||
ignore::DeprecationWarning:vat_moss
|
ignore::DeprecationWarning:vat_moss
|
||||||
ignore:.*ast.NameConstant.*:DeprecationWarning:reportlab
|
ignore:.*ast.NameConstant.*:DeprecationWarning:reportlab
|
||||||
|
ignore:.*utcnow.*:DeprecationWarning:openpyxl
|
||||||
ignore:.*PyType_Spec.*:DeprecationWarning:
|
ignore:.*PyType_Spec.*:DeprecationWarning:
|
||||||
ignore:.*truth value.*:DeprecationWarning:sepaxml
|
ignore:.*truth value.*:DeprecationWarning:sepaxml
|
||||||
ignore::pytz_deprecation_shim._exceptions.PytzUsageWarning:vobject
|
ignore::pytz_deprecation_shim._exceptions.PytzUsageWarning:vobject
|
||||||
|
|||||||
Reference in New Issue
Block a user