Skip to content

Commit c80545d

Browse files
authored
Merge branch 'main' into fix-social-card-links
2 parents a817b5a + 04fb7e2 commit c80545d

File tree

37 files changed

+474
-265
lines changed

37 files changed

+474
-265
lines changed

.github/workflows/backend-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
check-migrations:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
defaults:
1414
run:
1515
working-directory: backend

.github/workflows/backend-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
unit-tests:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-24.04
1616
defaults:
1717
run:
1818
working-directory: backend

.github/workflows/deploy.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313

1414
jobs:
1515
create-db:
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1717
defaults:
1818
run:
1919
working-directory: ./infrastructure/applications
@@ -195,7 +195,7 @@ jobs:
195195
platforms: linux/arm64
196196

197197
terraform:
198-
runs-on: ubuntu-latest
198+
runs-on: ubuntu-24.04
199199
needs: [build-and-push-arm-service, build-pretix, create-db]
200200
environment:
201201
name: ${{ fromJSON('["pastaporto", "production"]')[github.ref == 'refs/heads/main'] }}
@@ -229,7 +229,7 @@ jobs:
229229
AWS_DEFAULT_REGION: eu-central-1
230230

231231
wait-aws-update:
232-
runs-on: ubuntu-latest
232+
runs-on: ubuntu-24.04
233233
needs: [terraform]
234234
steps:
235235
- name: Check health status
@@ -274,7 +274,7 @@ jobs:
274274
id: image
275275
run: |
276276
set +e
277-
aws ecr describe-images --repository-name=pythonit/pycon-frontend --image-ids=imageTag=${{ steps.git.outputs.githash }}
277+
aws ecr describe-images --repository-name=pythonit/${{ fromJSON('["pastaporto", "production"]')[github.ref == 'refs/heads/main'] }}-pycon-frontend --image-ids=imageTag=${{ steps.git.outputs.githash }}
278278
if [[ $? == 0 ]]; then
279279
echo "image_exists=1" >> $GITHUB_OUTPUT
280280
else
@@ -315,7 +315,7 @@ jobs:
315315
builder: ${{ steps.buildx.outputs.name }}
316316
provenance: false
317317
push: true
318-
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/pycon-frontend:${{ steps.git.outputs.githash }}
318+
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/${{ fromJSON('["pastaporto", "production"]')[github.ref == 'refs/heads/main'] }}-pycon-frontend:${{ steps.git.outputs.githash }}
319319
cache-from: type=local,src=/tmp/.buildx-cache
320320
cache-to: type=local,dest=/tmp/.buildx-cache
321321
platforms: linux/arm64
@@ -325,9 +325,10 @@ jobs:
325325
CMS_ADMIN_HOST=${{ fromJSON('["pastaporto-", ""]')[github.ref == 'refs/heads/main'] }}admin.pycon.it
326326
CMS_HOSTNAME=${{ steps.vars.outputs.cms_hostname }}
327327
CONFERENCE_CODE=${{ steps.vars.outputs.conference_code }}
328+
GIT_HASH=${{ steps.git.outputs.githash }}
328329
329330
deploy-fe:
330-
runs-on: ubuntu-latest
331+
runs-on: ubuntu-24.04
331332
needs: [build-fe]
332333
environment:
333334
name: ${{ fromJSON('["pastaporto", "production"]')[github.ref == 'refs/heads/main'] }}

.github/workflows/frontend-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
lint:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
defaults:
1515
run:
1616
working-directory: ./frontend

.github/workflows/global-terraform-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313

1414
jobs:
1515
apply-changes:
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1717
defaults:
1818
run:
1919
working-directory: ./infrastructure/global

.github/workflows/global-terraform-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
jobs:
1313
lint:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-24.04
1515

1616
steps:
1717
- uses: actions/checkout@v4

.github/workflows/slash-commands.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
slash-command-dispatch:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- uses: actions/github-script@v3
1212
id: get-pr

.github/workflows/terminate-staging-env.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010

1111
jobs:
1212
terminate-env:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
defaults:
1515
run:
1616
working-directory: ./infrastructure/applications

.github/workflows/terraform-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
jobs:
1313
tfsec:
1414
name: TFSec
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-24.04
1616

1717
permissions:
1818
contents: read
@@ -27,7 +27,7 @@ jobs:
2727
github_token: ${{ github.token }}
2828

2929
lint:
30-
runs-on: ubuntu-latest
30+
runs-on: ubuntu-24.04
3131

3232
steps:
3333
- uses: actions/checkout@v4

backend/grants/admin.py

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from datetime import timedelta
1111
from typing import Dict, List, Optional
1212
from countries.filters import CountryFilter
13-
from django import forms
1413
from django.contrib import admin, messages
1514
from django.db.models.query import QuerySet
1615
from django.utils import timezone
@@ -30,6 +29,7 @@
3029
from django.db.models import Exists, OuterRef
3130

3231
from django.contrib.admin import SimpleListFilter
32+
from participants.models import Participant
3333

3434
EXPORT_GRANTS_FIELDS = (
3535
"name",
@@ -351,39 +351,6 @@ def mark_rejected_and_send_email(modeladmin, request, queryset):
351351
messages.info(request, f"Sent Rejected reply email to {grant.name}")
352352

353353

354-
class GrantAdminForm(forms.ModelForm):
355-
class Meta:
356-
model = Grant
357-
fields = (
358-
"id",
359-
"name",
360-
"status",
361-
"approved_type",
362-
"ticket_amount",
363-
"travel_amount",
364-
"accommodation_amount",
365-
"total_amount",
366-
"full_name",
367-
"conference",
368-
"user",
369-
"age_group",
370-
"gender",
371-
"occupation",
372-
"grant_type",
373-
"python_usage",
374-
"been_to_other_events",
375-
"needs_funds_for_travel",
376-
"why",
377-
"notes",
378-
"nationality",
379-
"departure_country",
380-
"departure_city",
381-
"country_type",
382-
"applicant_reply_sent_at",
383-
"applicant_reply_deadline",
384-
)
385-
386-
387354
class IsProposedSpeakerFilter(SimpleListFilter):
388355
title = "Is Proposed Speaker"
389356
parameter_name = "is_proposed_speaker"
@@ -420,7 +387,6 @@ def queryset(self, request, queryset):
420387
class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
421388
change_list_template = "admin/grants/grant/change_list.html"
422389
resource_class = GrantResource
423-
form = GrantAdminForm
424390
list_display = (
425391
"user_display_name",
426392
"country",
@@ -524,16 +490,27 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
524490
"been_to_other_events",
525491
"community_contribution",
526492
"notes",
527-
"website",
528-
"twitter_handle",
529-
"github_handle",
530-
"linkedin_url",
531-
"mastodon_handle",
532493
)
533494
},
534495
),
535496
)
536497

498+
def change_view(self, request, object_id, form_url="", extra_context=None):
499+
extra_context = extra_context or {}
500+
grant = self.model.objects.get(id=object_id)
501+
owner_id = grant.user_id
502+
extra_context["participant"] = Participant.objects.filter(
503+
user_id=owner_id,
504+
conference_id=grant.conference_id,
505+
).first()
506+
507+
return super().change_view(
508+
request,
509+
object_id,
510+
form_url,
511+
extra_context=extra_context,
512+
)
513+
537514
@admin.display(description="User", ordering="user__full_name")
538515
def user_display_name(self, obj):
539516
if obj.user_id:

0 commit comments

Comments
 (0)