-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: Credit Username on Approval #162
base: main
Are you sure you want to change the base?
Conversation
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.
For the migration, we can use the following script
--- migration.sql
-- Add column credit_username to table pending_posts
ALTER TABLE pending_post ADD COLUMN credit_username VARCHAR(255) DEFAULT NULL;
to run with run_sql migration.sql spotted.sqlite3
While the approach is correct, it introduces some inconsistencies with the current method. Right now the credited username is picked when the spot is sent to the channel.
sign = await User(user_id).get_user_sign(bot=self.__bot) |
meaning that if the user was not credited before spotting but becomes credited before the admins approve the spot, their username will appear without the admin's knowledge.
The same reasoning applies to the username: it could be changed during the approval time.
merge conflict |
Prerequisites
CHANGELOG.rst
file with an overview of the changes made.Description
This PR is a re-implementation of the now abandoned #114.
It follows a new approach: save the credited username when creating the PendingPost object.
(If applicable) Issue closed by this PR
Does this PR introduce a breaking change?
(If yes) What are the changes that might break existing applications?
The Pending Post database entity has been updated. Migrations script should be performed.
Python version you are using
Python 3.12.0