-
Notifications
You must be signed in to change notification settings - Fork 29
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
admin button to auto-gen & link Discord roles #746
Conversation
Why did you move this from the hunt edit page to the sidebar? I thought that made the most sense to me. I also think it's unlikely we ever want to modify these during the hunt FWIW |
idk i felt like i was expecting we'd want to add new tags to Discord as well, but it doesn't matter much |
890de0b
to
62173ea
Compare
moved back to |
chat/tasks.py
Outdated
if tag.color != PuzzleTagColor.BLUE and tag.color != PuzzleTagColor.WHITE: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also check if it's a default tag
chat/tasks.py
Outdated
if existing_chat_role.exists(): | ||
obj = existing_chat_role.first() | ||
if obj.role_id != discord_roles_by_name[tag.name]["id"]: | ||
with transaction.atomic(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually do anything if we're just doing a single operation? ditto below
hunts/views.py
Outdated
chat.tasks.sync_roles( | ||
hunt, | ||
settings.CHAT_DEFAULT_SERVICE, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will run this synchronously by the web process, right? Need to call .delay()
if you want to create a task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, nice!
addresses #671
ChatRole
for all Discord roles, meaning people with those roles will get pinged when a puzzle's tagged with the corresponding tag