Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪲 Check if classes and levels exist in adv #5292

Merged
merged 7 commits into from
Mar 25, 2024
Merged

🪲 Check if classes and levels exist in adv #5292

merged 7 commits into from
Mar 25, 2024

Conversation

Annelein
Copy link
Contributor

Fixes #5289

@Annelein Annelein requested a review from hasan-sh March 21, 2024 11:05
Comment on lines 1078 to 1079
if body.get("classes") and current_adventure.get('classes'):
current_classes = current_adventure["classes"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imagine current_adventure being an existing adventure. It most likely doesn't have classes, therefore the next line should be changed.

Suggested change
if body.get("classes") and current_adventure.get('classes'):
current_classes = current_adventure["classes"]
if body.get("classes"):
current_classes = current_adventure.get('classes', [])

Same goes for the levels you made below and all other places you use classes as well!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the only places

@Annelein Annelein requested a review from hasan-sh March 21, 2024 11:57
Copy link
Contributor

@hasan-sh hasan-sh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, will keep an eye and see it on prod.! Thanks:))

Copy link
Contributor

mergify bot commented Mar 25, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 2b48364 into main Mar 25, 2024
12 checks passed
@mergify mergify bot deleted the adv-bug branch March 25, 2024 13:33
Copy link
Contributor

mergify bot commented Mar 25, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🪲 adding an adventure to classes
3 participants