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

Allow admin to restrict certain accolades to Ally or Enemy only #585

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jauggy
Copy link
Member

@jauggy jauggy commented Feb 9, 2025

This PR allows the admin to restrict certain accolades to ally or enemy only. By default restriction is set to null which means any.

The migration script will do the following:

  1. Add a new column to teiserver_account_badge_types: restriction
  2. Add a constraint such that this column can only by NULL, "Ally", or "Enemy"
  3. Update the "Good Teammate" accolade so that it is restricted to Ally (if it exists already). This can still be changed by the Admin via the website.

Testing

Go to http://localhost:4000/teiserver/admin/badge_types
and you should see a new column called restriction. You can edit an accolade's restriction.

For example, if Good Teammate is ally only, then you cannot give this accolade in a match where you weren't the ally of the person you are gifting to.

1

@jauggy jauggy marked this pull request as ready for review February 9, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant