Skip to content

Commit 95f98c7

Browse files
committed
Merge branch 'main' into release
2 parents 0109c6e + db9d241 commit 95f98c7

File tree

8 files changed

+60
-14
lines changed

8 files changed

+60
-14
lines changed

fixtures/boxes.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,9 @@
654654
"created": "2014-11-13T21:49:22.048Z",
655655
"updated": "2021-07-29T21:40:21.030Z",
656656
"label": "download-dev",
657-
"content": "<h2>Information about specific ports, and developer info</h2>\r\n\r\n<ul>\r\n <li><a href=\"/downloads/windows/\">Windows</a></li>\r\n <li><a href=\"/downloads/macos/\">Macintosh</a></li>\r\n <li><a href=\"/download/other/\">Other platforms</a></li>\r\n <li><a href=\"/downloads/source/\">Source</a></li>\r\n <li><a href=\"/dev/\">Python Developer's Guide</a></li>\r\n <li><a href=\"http://bugs.python.org\">Python Issue Tracker</a></li>\r\n</ul>",
657+
"content": "<h2>Information about specific ports, and developer info</h2>\r\n\r\n<ul>\r\n <li><a href=\"/downloads/windows/\">Windows</a></li>\r\n <li><a href=\"/downloads/macos/\">Macintosh</a></li>\r\n <li><a href=\"/download/other/\">Other platforms</a></li>\r\n <li><a href=\"/downloads/source/\">Source</a></li>\r\n <li><a href=\"/dev/\">Python Developer's Guide</a></li>\r\n <li><a href=\"https://github.com/python/cpython/issues\">Python Issue Tracker</a></li>\r\n</ul>",
658658
"content_markup_type": "html",
659-
"_content_rendered": "<h2>Information about specific ports, and developer info</h2>\r\n\r\n<ul>\r\n <li><a href=\"/downloads/windows/\">Windows</a></li>\r\n <li><a href=\"/downloads/macos/\">Macintosh</a></li>\r\n <li><a href=\"/download/other/\">Other platforms</a></li>\r\n <li><a href=\"/downloads/source/\">Source</a></li>\r\n <li><a href=\"/dev/\">Python Developer's Guide</a></li>\r\n <li><a href=\"http://bugs.python.org\">Python Issue Tracker</a></li>\r\n</ul>"
659+
"_content_rendered": "<h2>Information about specific ports, and developer info</h2>\r\n\r\n<ul>\r\n <li><a href=\"/downloads/windows/\">Windows</a></li>\r\n <li><a href=\"/downloads/macos/\">Macintosh</a></li>\r\n <li><a href=\"/download/other/\">Other platforms</a></li>\r\n <li><a href=\"/downloads/source/\">Source</a></li>\r\n <li><a href=\"/dev/\">Python Developer's Guide</a></li>\r\n <li><a href=\"https://github.com/python/cpython/issues\">Python Issue Tracker</a></li>\r\n</ul>"
660660
}
661661
},
662662
{

fixtures/sitetree_menus.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@
685685
"fields": {
686686
"title": "PEP Index",
687687
"hint": "",
688-
"url": "http://python.org/dev/peps/",
688+
"url": "https://peps.python.org",
689689
"urlaspattern": false,
690690
"tree": 1,
691691
"hidden": false,

sponsors/forms.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from django import forms
44
from django.conf import settings
55
from django.contrib.admin.widgets import AdminDateWidget
6+
from django.core.validators import FileExtensionValidator
67
from django.db.models import Q
78
from django.utils import timezone
89
from django.utils.functional import cached_property
@@ -225,10 +226,11 @@ class SponsorshipApplicationForm(forms.Form):
225226
help_text="For display on our sponsor webpage. High resolution PNG or JPG, smallest dimension no less than 256px",
226227
required=False,
227228
)
228-
print_logo = forms.ImageField(
229+
print_logo = forms.FileField(
229230
label="Sponsor print logo",
230231
help_text="For printed materials, signage, and projection. SVG or EPS",
231232
required=False,
233+
validators=[FileExtensionValidator(['eps', 'epsf' 'epsi', 'svg', 'png'])],
232234
)
233235

234236
primary_phone = forms.CharField(
@@ -557,10 +559,11 @@ class SponsorUpdateForm(forms.ModelForm):
557559
help_text="For display on our sponsor webpage. High resolution PNG or JPG, smallest dimension no less than 256px",
558560
required=False,
559561
)
560-
print_logo = forms.ImageField(
562+
print_logo = forms.FileField(
561563
widget=forms.widgets.FileInput,
562564
help_text="For printed materials, signage, and projection. SVG or EPS",
563565
required=False,
566+
validators=[FileExtensionValidator(['eps', 'epsf' 'epsi', 'svg', 'png'])],
564567
)
565568

566569
def __init__(self, *args, **kwargs):

sponsors/management/commands/create_pycon_vouchers_for_sponsors.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,26 @@
2020
)
2121

2222
BENEFITS = {
23-
121: {
24-
"internal_name": "full_conference_passes_2023_code",
23+
183: {
24+
"internal_name": "full_conference_passes_code_2024",
2525
"voucher_type": "SPNS_COMP_",
2626
},
27-
139: {
28-
"internal_name": "expo_hall_only_passes_2023_code",
27+
201: {
28+
"internal_name": "expo_hall_only_passes_code_2024",
2929
"voucher_type": "SPNS_EXPO_COMP_",
3030
},
31-
148: {
32-
"internal_name": "additional_full_conference_passes_2023_code",
31+
208: {
32+
"internal_name": "additional_full_conference_passes_code_2024",
3333
"voucher_type": "SPNS_ADDL_DISC_REG_",
3434
},
35-
166: {
36-
"internal_name": "online_only_conference_passes_2023_code",
35+
225: {
36+
"internal_name": "online_only_conference_passes_2024",
3737
"voucher_type": "SPNS_ONLINE_COMP_",
3838
},
39+
237: {
40+
"internal_name": "additional_expo_hall_only_passes_2024",
41+
"voucher_type": "SPNS_EXPO_DISC_",
42+
},
3943
}
4044

4145

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 2.2.24 on 2023-12-24 18:54
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('sponsors', '0098_auto_20231219_1910'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='sponsor',
16+
name='print_logo',
17+
field=models.FileField(blank=True, help_text='For printed materials, signage, and projection. SVG or EPS', null=True, upload_to='sponsor_print_logos', validators=[django.core.validators.FileExtensionValidator(['eps', 'epsfepsi', 'svg', 'png'])], verbose_name='Print logo'),
18+
),
19+
]

sponsors/models/sponsors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
from allauth.account.models import EmailAddress
55
from django.conf import settings
6+
from django.core.validators import FileExtensionValidator
67
from django.db import models
78
from django.core.exceptions import ObjectDoesNotExist
89
from django.template.defaultfilters import slugify
@@ -51,6 +52,7 @@ class Sponsor(ContentManageable):
5152
)
5253
print_logo = models.FileField(
5354
upload_to="sponsor_print_logos",
55+
validators=[FileExtensionValidator(['eps', 'epsf' 'epsi', 'svg', 'png'])],
5456
blank=True,
5557
null=True,
5658
verbose_name="Print logo",

sponsors/tests/test_forms.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from pathlib import Path
2+
3+
from django.core.files.uploadedfile import SimpleUploadedFile
14
from model_bakery import baker
25

36
from django.conf import settings
@@ -438,6 +441,21 @@ def test_create_sponsor_with_valid_data_for_non_required_inputs(
438441
self.assertEqual(sponsor.landing_page_url, "https://companyx.com")
439442
self.assertEqual(sponsor.twitter_handle, "@companyx")
440443

444+
def test_create_sponsor_with_svg_for_print_logo(
445+
self,
446+
):
447+
tick_svg = Path(settings.STATICFILES_DIRS[0]) / "img"/"sponsors"/"tick.svg"
448+
with tick_svg.open("rb") as fd:
449+
uploaded_svg = SimpleUploadedFile("tick.svg", fd.read())
450+
self.files["print_logo"] = uploaded_svg
451+
452+
form = SponsorshipApplicationForm(self.data, self.files)
453+
self.assertTrue(form.is_valid(), form.errors)
454+
455+
sponsor = form.save()
456+
457+
self.assertTrue(sponsor.print_logo)
458+
441459
def test_use_previous_user_sponsor(self):
442460
contact = baker.make(SponsorContact, user__email="[email protected]")
443461
self.data = {"sponsor": contact.sponsor.id}

templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
<link rel="author" href="/humans.txt">
8787

8888
<link rel="alternate" type="application/rss+xml" title="Python Enhancement Proposals"
89-
href="https://www.python.org/dev/peps/peps.rss/">
89+
href="https://peps.python.org/peps.rss">
9090
<link rel="alternate" type="application/rss+xml" title="Python Job Opportunities"
9191
href="https://www.python.org/jobs/feed/rss/">
9292
<link rel="alternate" type="application/rss+xml" title="Python Software Foundation News"

0 commit comments

Comments
 (0)