-
Notifications
You must be signed in to change notification settings - Fork 4
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
first cut at keyword subscriptions #81
base: master
Are you sure you want to change the base?
Conversation
cecad89
to
8125b02
Compare
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.
Looks generally good to me, see comments.
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): |
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.
You will need to remove this migration from your PR -- I have not found a way to get Django to stop generating it. It happens because we set the default value of the hunt_id
field based on an environment variable that we change every year. (Some better way of configuring that is obviously on the todo list but it's not really a practical necessity.) Even though the default value is always supplied explicitly by Django, and the database field's own default value is never used, Django still really really wants to create a migration to irrelevantly change the database's default value.
if instance.tags != instance.tracker.previous('tags') and instance.tracker.previous('tags') is not None: | ||
post_update.delay(instance.slug, 'tags', instance.tags) | ||
old_keywords.update(re.findall('\w+', instance.tracker.previous('tags').lower())) |
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.
Technically you are ignoring the fact that tags are supposed to be a list, and treating them as a bag of words. I don't strenuously object to that, but I figured I'd note it. (I think probably in fact they should be stored more cleverly than a comma-separated string in the database, but that's where we currently are.)
] | ||
|
||
operations = [ | ||
migrations.AddField( |
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.
What is the expected format of the field? It looks like either space-separated or comma-separated might work ok?
@@ -230,6 +230,30 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent): | |||
target_channel = message.channel_mentions[0] | |||
await self.add_user_to_puzzle(payload.member, target_channel.name) | |||
|
|||
# TODO: Merge this with the above when not in ultra-conservative mode |
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.
Go ahead and merge it, and eliminate the requirement that it be the bot's message while you're at it? (Per separate discussion about this being a desirable feature.) So that just any SIGNUP_EMOJI react, to any message the bot can see that mentions a puzzle channel, counts.
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.
Oh sorry, this is what Paul already fixed in #91. Rebase on top of that instead, presumably.
|
||
// Possibly this should apply to all labels, but trying to be | ||
// ultra-conservative right now | ||
label[for="id_subscriptions"] { |
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 literally only affect the visual appearance of the admin form? Or what is this restyling? If it's just the admin form, I don't care as long as it still works, make it pretty however you want. But I'm actually confused about why it's necessary -- the admin form appears to be styled fine to me, with labels at the top, and if I try adding this style to one of them for testing, it totally breaks the page...
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.
Ohhh, the admin and non-admin default forms share the exact same property for this. Amazing. I think if you apply this it might break the admin form, I'm not sure. Presumably there's some intended way to style just the user-side form...
Things I'd work on if I didn't want to keep this as small as possible for you:
But I'm pretty jazzed about this anyway and I hope you get a chance to take a look.