-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix numerous bugs; v1.1.0 (#91)
- Loading branch information
Showing
20 changed files
with
756 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from urllib.parse import parse_qs, urlsplit # noqa: E402 | ||
|
||
import requests # noqa: E402 | ||
from core.models import ExperiencePage # noqa: E402 | ||
from django.core.management import BaseCommand # noqa: E402 | ||
|
||
|
||
def request_response_handler(response, *args, **kwargs): | ||
"""Async callback for response""" | ||
print(response) | ||
|
||
|
||
def exception_handler(*args): | ||
"""Async callback for error handling""" | ||
print(args) | ||
|
||
|
||
class Command(BaseCommand): | ||
"""A command to validate all share codes and playground URL""" | ||
|
||
help = "validates all share codes and playground URL" | ||
|
||
def handle(self, *args, **options): # noqa: D102 | ||
experiences = ExperiencePage.objects.live().public() | ||
urls = [] | ||
experience: ExperiencePage | ||
for experience in experiences: | ||
base_url = "https://api.gametools.network/bf2042/playground/?{}&blockydata=false&lang=en-us" | ||
if experience.exp_url: | ||
parsed_url = urlsplit(experience.exp_url) | ||
query_dict = parse_qs(parsed_url.query) | ||
if playgroundId := query_dict.get("playgroundId", None): | ||
urls.append(base_url.format(f"playgroundid={playgroundId[0]}")) | ||
elif experience.code: | ||
urls.append(base_url.format(f"experiencecode={experience.code}")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 3.2.12 on 2022-10-03 19:43 | ||
|
||
import markdownx.models | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0055_auto_20221001_1417"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="experiencescategory", | ||
name="description", | ||
field=markdownx.models.MarkdownxField( | ||
blank=True, | ||
help_text="description of this category that is shown on /category/", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="subcategory", | ||
name="description", | ||
field=markdownx.models.MarkdownxField( | ||
blank=True, | ||
help_text="description of this category that is shown on /category/", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 3.2.12 on 2022-10-03 20:07 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0056_auto_20221003_1943"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="profile", | ||
name="hide_username", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="If set to true hides the username on the website", | ||
), | ||
), | ||
] |
Oops, something went wrong.