Update mod action types
This commit is contained in:
parent
de55efbb1a
commit
9a864f227a
2 changed files with 45 additions and 20 deletions
|
@ -85,6 +85,26 @@ class ModAction(CreatedBase):
|
|||
return f"/log/{self.id}"
|
||||
|
||||
ACTIONTYPES = {
|
||||
'approve_post': {
|
||||
"str": 'approved post {self.target_link}',
|
||||
"icon": 'fa-feather-alt',
|
||||
"color": 'bg-success'
|
||||
},
|
||||
'approve_comment': {
|
||||
"str": 'approved {self.target_link}',
|
||||
"icon": 'fa-comment',
|
||||
"color": 'bg-success'
|
||||
},
|
||||
'remove_post': {
|
||||
"str": 'removed post {self.target_link}',
|
||||
"icon": 'fa-feather-alt',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'remove_comment': {
|
||||
"str": 'removed {self.target_link}',
|
||||
"icon": 'fa-comment',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'approve_app': {
|
||||
"str": 'approved an application by {self.target_link}',
|
||||
"icon": 'fa-robot',
|
||||
|
@ -100,21 +120,11 @@ ACTIONTYPES = {
|
|||
"icon": 'fa-badge',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'remove_comment': {
|
||||
"str": 'removed {self.target_link}',
|
||||
"icon": 'fa-comment',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'ban_domain': {
|
||||
"str": 'banned a domain',
|
||||
"icon": 'fa-globe',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'remove_post': {
|
||||
"str": 'removed post {self.target_link}',
|
||||
"icon": 'fa-feather-alt',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'ban_user': {
|
||||
"str": 'banned user {self.target_link}',
|
||||
"icon": 'fa-user-slash',
|
||||
|
@ -300,21 +310,11 @@ ACTIONTYPES = {
|
|||
"icon": 'fa-eye-slash',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'unremove_comment': {
|
||||
"str": 'reinstated {self.target_link}',
|
||||
"icon": 'fa-comment',
|
||||
"color": 'bg-success'
|
||||
},
|
||||
'unban_domain': {
|
||||
"str": 'unbanned a domain',
|
||||
"icon": 'fa-globe',
|
||||
"color": 'bg-success'
|
||||
},
|
||||
'unremove_post': {
|
||||
"str": 'reinstated post {self.target_link}',
|
||||
"icon": 'fa-feather-alt',
|
||||
"color": 'bg-success'
|
||||
},
|
||||
'unban_user': {
|
||||
"str": 'unbanned user {self.target_link}',
|
||||
"icon": 'fa-user',
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
"""Rename approve mod actions
|
||||
|
||||
Revision ID: a23fe2f1515c
|
||||
Revises: 7ae4658467d7
|
||||
Create Date: 2023-07-22 14:37:20.485816+00:00
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a23fe2f1515c'
|
||||
down_revision = '7ae4658467d7'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("UPDATE modactions SET kind='approve_post' WHERE kind='unremove_post';")
|
||||
op.execute("UPDATE modactions SET kind='approve_comment' WHERE kind='unremove_comment';")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.execute("UPDATE modactions SET kind='unremove_post' WHERE kind='approve_post';")
|
||||
op.execute("UPDATE modactions SET kind='unremove_comment' WHERE kind='approve_comment';")
|
Loading…
Add table
Add a link
Reference in a new issue