From 7570a546498c079b8d01e7bd541a09ac09fc94e1 Mon Sep 17 00:00:00 2001 From: Vibhakar Solanki Date: Sun, 19 Mar 2023 20:55:54 +0530 Subject: [PATCH 1/7] feat: add github sponsors info --- .github/funding.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/funding.yaml b/.github/funding.yaml index 498559d..f9b1ada 100644 --- a/.github/funding.yaml +++ b/.github/funding.yaml @@ -1 +1,2 @@ +github: [battlefield-portal-community] patreon: battlefield_portal_community From bd0393dd625191d392d85fe3cb8d1437da47c620 Mon Sep 17 00:00:00 2001 From: p0lygun Date: Sat, 25 Mar 2023 17:18:02 +0530 Subject: [PATCH 2/7] fix: add CSRF_TRUSTED_ORIGINS to settings --- bfportal/bfportal/settings/production.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bfportal/bfportal/settings/production.py b/bfportal/bfportal/settings/production.py index ec4a833..737375e 100644 --- a/bfportal/bfportal/settings/production.py +++ b/bfportal/bfportal/settings/production.py @@ -8,6 +8,7 @@ SECRET_KEY = os.environ.get("PRODUCTION_KEY") ALLOWED_HOSTS = os.environ.get("PRODUCTION_HOST").split(",") ALLOWED_HOSTS.append("localhost") +CSRF_TRUSTED_ORIGINS = ["https://*.bfportal.gg/"] logger.debug(f"Allowed Hosts {ALLOWED_HOSTS}") try: From 2a0c43587f457a85db0816f86e16bfd75f664c8b Mon Sep 17 00:00:00 2001 From: Vibhakar Solanki Date: Sat, 25 Mar 2023 17:22:53 +0530 Subject: [PATCH 3/7] feat: add WIP action to manage PRs --- .github/workflows/wip.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/wip.yml diff --git a/.github/workflows/wip.yml b/.github/workflows/wip.yml new file mode 100644 index 0000000..6e71c2e --- /dev/null +++ b/.github/workflows/wip.yml @@ -0,0 +1,12 @@ +name: WIP +on: + pull_request: + types: [opened, synchronize, reopened, edited] + +jobs: + wip: + runs-on: ubuntu-latest + steps: + - uses: wip/action@v1.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From fd9b28c0e5f61606e261565fca780c1cdb860e49 Mon Sep 17 00:00:00 2001 From: p0lygun Date: Tue, 28 Mar 2023 23:03:31 +0530 Subject: [PATCH 4/7] fix: make categories required; fixes #149 --- bfportal/core/forms.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bfportal/core/forms.py b/bfportal/core/forms.py index 841afec..5225c54 100644 --- a/bfportal/core/forms.py +++ b/bfportal/core/forms.py @@ -19,6 +19,7 @@ def __init__(self, *args, **kwargs): self.fields["sub_categories"].queryset = SubCategory.objects.filter( selectable_on_form=True ) + self.fields["category"].required = True self.fields["cover_img_url"].required = True creators = AutoCompleteSelectMultipleField( @@ -80,7 +81,11 @@ def clean_category(self): def clean_code(self): """Called when code field is being validated""" code = self.cleaned_data["code"] - if self.cleaned_data["category"].name.lower() != "prefab" and not len(code): + if ( + self.cleaned_data.get("category", None) + and self.cleaned_data["category"].name.lower() != "prefab" + and not len(code) + ): raise forms.ValidationError( "Must provide experience code if category is other than prefab" ) @@ -92,7 +97,11 @@ def clean_code(self): def clean_exp_url(self): """Called when experience url field is being validated""" url = self.cleaned_data["exp_url"] - if self.cleaned_data["category"].name.lower() == "prefab" and not len(url): + if ( + self.cleaned_data.get("category", None) + and self.cleaned_data["category"].name.lower() == "prefab" + and not len(url) + ): raise forms.ValidationError( "Must provide experience url if category is prefab" ) From 6a6a1bc477c5f0833080fbd8160d8bc6ac9f5e78 Mon Sep 17 00:00:00 2001 From: p0lygun Date: Tue, 28 Mar 2023 23:32:40 +0530 Subject: [PATCH 5/7] chore: clean up readme --- readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 9089373..0557f6f 100644 --- a/readme.md +++ b/readme.md @@ -6,8 +6,7 @@ [![Docker Build](https://github.com/battlefield-portal-community/bfportal.gg/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/battlefield-portal-community/bfportal.gg/actions/workflows/main.yml) # What is this ? -With the release of battlefield 2042, ripple effect studio, added the ability to make custom game modes called "experiences", currently there is no way to share a game mode outside of the game, this project aims to fill that gap. -This project will replace the current website at https://bfportal.gg/ +With the release of battlefield 2042, ripple effect studio, added the ability to make custom game modes called "experiences", currently there is no way to share a game mode outside of the game, this project aims to fill that gap. # Info Head over to [bfportal.gg](https://bfportal.gg/), and try it out From 7a1a18beec733e14aac9c03f6feef26251dc3bb9 Mon Sep 17 00:00:00 2001 From: p0lygun Date: Tue, 28 Mar 2023 23:33:53 +0530 Subject: [PATCH 6/7] feat: remove update-portainer workflow --- .github/workflows/main.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 075264a..2c54a4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,14 +48,3 @@ jobs: echo VERSION=$VERSION docker tag $BRANCH_NAME $IMAGE_ID:$VERSION docker push $IMAGE_ID:$VERSION - - update-portainer: - needs: production-deploy - runs-on: ubuntu-latest - steps: - - name: post to webhook - uses: fjogeleit/http-request-action@v1 - with: - url: ${{ secrets.PORTAINER_WEBHOOK_URL }} - method: 'POST' - timeout: 180000 From 40d4296241156449f3582be0b3d817a743110392 Mon Sep 17 00:00:00 2001 From: p0lygun Date: Tue, 4 Apr 2023 23:46:29 +0530 Subject: [PATCH 7/7] feat: add field to api --- bfportal/core/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bfportal/core/api.py b/bfportal/core/api.py index 9ed0e54..195b2c0 100644 --- a/bfportal/core/api.py +++ b/bfportal/core/api.py @@ -23,6 +23,7 @@ class ExperiencePageAPIViewSet(BaseAPIViewSet): "featured", "bugged", "xp_farm", + "broken", "like_count", "exp_creators", ]