arrr
This commit is contained in:
parent
08d9c793b3
commit
54e784b4a2
4 changed files with 224 additions and 211 deletions
|
@ -110,267 +110,270 @@ class ModAction(Base):
|
||||||
return f"{SITE_FULL}/log/{self.id}"
|
return f"{SITE_FULL}/log/{self.id}"
|
||||||
|
|
||||||
ACTIONTYPES = {
|
ACTIONTYPES = {
|
||||||
"grant_awards": {
|
'agendaposter': {
|
||||||
"str": "granted awards to {self.target_link}",
|
"str": 'set chud theme on {self.target_link}',
|
||||||
"icon": "fa-gift",
|
"icon": 'fa-snooze',
|
||||||
"color": "bg-primary",
|
"color": 'bg-danger'
|
||||||
},
|
},
|
||||||
"check": {
|
'approve_app': {
|
||||||
"str": "gave {self.target_link} a checkmark",
|
"str": 'approved an application by {self.target_link}',
|
||||||
"icon": "fa-badge-check",
|
"icon": 'fa-robot',
|
||||||
"color": "bg-success",
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
"uncheck": {
|
'badge_grant': {
|
||||||
"str": "removed checkmark from {self.target_link}",
|
|
||||||
"icon": "fa-badge-check",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"ban_domain": {
|
|
||||||
"str": "banned a domain",
|
|
||||||
"icon": "fa-globe",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unban_domain": {
|
|
||||||
"str": "unbanned a domain",
|
|
||||||
"icon": "fa-globe",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"approve_app": {
|
|
||||||
"str": "approved an application by {self.target_link}",
|
|
||||||
"icon": "fa-robot",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"revoke_app": {
|
|
||||||
"str": "revoked an application by {self.target_link}",
|
|
||||||
"icon": "fa-robot",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"reject_app": {
|
|
||||||
"str": "rejected an application request by {self.target_link}",
|
|
||||||
"icon": "fa-robot",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"change_sidebar": {
|
|
||||||
"str": "changed the sidebar",
|
|
||||||
"icon": "fa-columns",
|
|
||||||
"color": "bg-primary",
|
|
||||||
},
|
|
||||||
"disable_signups": {
|
|
||||||
"str": "disabled signups",
|
|
||||||
"icon": "fa-users",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"enable_signups": {
|
|
||||||
"str": "enabled signups",
|
|
||||||
"icon": "fa-users",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"disable_under_attack": {
|
|
||||||
"str": "disabled under attack mode",
|
|
||||||
"icon": "fa-shield",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"enable_under_attack": {
|
|
||||||
"str": "enabled under attack mode",
|
|
||||||
"icon": "fa-shield",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"ban_user":{
|
|
||||||
"str":'banned user {self.target_link}',
|
|
||||||
"icon":"fa-user-slash",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unban_user":{
|
|
||||||
"str":'unbanned user {self.target_link}',
|
|
||||||
"icon": "fa-user",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"nuke_user":{
|
|
||||||
"str":'removed all content of {self.target_link}',
|
|
||||||
"icon":"fa-radiation-alt",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unnuke_user":{
|
|
||||||
"str":'approved all content of {self.target_link}',
|
|
||||||
"icon": "fa-radiation-alt",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"shadowban": {
|
|
||||||
"str": 'shadowbanned {self.target_link}',
|
|
||||||
"icon": "fa-eye-slash",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unshadowban": {
|
|
||||||
"str": 'unshadowbanned {self.target_link}',
|
|
||||||
"icon": "fa-eye",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"agendaposter": {
|
|
||||||
"str": "set chud theme on {self.target_link}",
|
|
||||||
"icon": "fa-snooze",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unagendaposter": {
|
|
||||||
"str": "removed chud theme from {self.target_link}",
|
|
||||||
"icon": "fa-snooze",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"set_flair_locked":{
|
|
||||||
"str":"set {self.target_link}'s flair (locked)",
|
|
||||||
"icon": "fa-award",
|
|
||||||
"color": "bg-primary",
|
|
||||||
},
|
|
||||||
"set_flair_notlocked":{
|
|
||||||
"str":"set {self.target_link}'s flair (not locked)",
|
|
||||||
"icon": "fa-award",
|
|
||||||
"color": "bg-primary",
|
|
||||||
},
|
|
||||||
"pin_comment":{
|
|
||||||
"str":'pinned a {self.target_link}',
|
|
||||||
"icon":"fa-thumbtack fa-rotate--45",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"unpin_comment":{
|
|
||||||
"str":'un-pinned a {self.target_link}',
|
|
||||||
"icon":"fa-thumbtack fa-rotate--45",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"pin_post":{
|
|
||||||
"str":'pinned post {self.target_link}',
|
|
||||||
"icon":"fa-thumbtack fa-rotate--45",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"unpin_post":{
|
|
||||||
"str":'un-pinned post {self.target_link}',
|
|
||||||
"icon":"fa-thumbtack fa-rotate--45",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"set_nsfw":{
|
|
||||||
"str":'set nsfw on post {self.target_link}',
|
|
||||||
"icon":"fa-eye-evil",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unset_nsfw":{
|
|
||||||
"str":'un-set nsfw on post {self.target_link}',
|
|
||||||
"icon":"fa-eye-evil",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"ban_post":{
|
|
||||||
"str": 'removed post {self.target_link}',
|
|
||||||
"icon":"fa-feather-alt",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unban_post":{
|
|
||||||
"str": 'reinstated post {self.target_link}',
|
|
||||||
"icon":"fa-feather-alt",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"ban_comment":{
|
|
||||||
"str": 'removed {self.target_link}',
|
|
||||||
"icon":"fa-comment",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"unban_comment":{
|
|
||||||
"str": 'reinstated {self.target_link}',
|
|
||||||
"icon":"fa-comment",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"delete_report":{
|
|
||||||
"str": 'deleted report on {self.target_link}',
|
|
||||||
"icon":"fa-flag",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"make_admin": {
|
|
||||||
"str": 'made {self.target_link} admin',
|
|
||||||
"icon": "fa-user-crown",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"remove_admin": {
|
|
||||||
"str": 'removed {self.target_link} as admin',
|
|
||||||
"icon": "fa-user-crown",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"make_meme_admin": {
|
|
||||||
"str": 'made {self.target_link} meme admin',
|
|
||||||
"icon": "fa-user-crown",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"remove_meme_admin": {
|
|
||||||
"str": 'removed {self.target_link} as meme admin',
|
|
||||||
"icon": "fa-user-crown",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"distribute":{
|
|
||||||
"str": 'distributed bet winnings to voters on {self.target_link}',
|
|
||||||
"icon":"fa-dollar-sign",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"revert":{
|
|
||||||
"str": 'reverted {self.target_link} mod actions',
|
|
||||||
"icon":"fa-history",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"club_allow":{
|
|
||||||
"str":'allowed user {self.target_link} into the {cc}',
|
|
||||||
"icon":"fa-golf-club",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"club_ban":{
|
|
||||||
"str":'disallowed user {self.target_link} from the {cc}',
|
|
||||||
"icon": "fa-golf-club",
|
|
||||||
"color": "bg-danger",
|
|
||||||
},
|
|
||||||
"monthly":{
|
|
||||||
"str": 'distributed monthly marseybux',
|
|
||||||
"icon":"fa-sack-dollar",
|
|
||||||
"color": "bg-success",
|
|
||||||
},
|
|
||||||
"purge_cache":{
|
|
||||||
"str": 'purged cache',
|
|
||||||
"icon":"fa-memory",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"dump_cache":{
|
|
||||||
"str": 'dumped cache',
|
|
||||||
"icon":"fa-trash-alt",
|
|
||||||
"color": "bg-muted",
|
|
||||||
},
|
|
||||||
"badge_grant":{
|
|
||||||
"str": 'granted badge to {self.target_link}',
|
"str": 'granted badge to {self.target_link}',
|
||||||
"icon":"fa-badge",
|
"icon": 'fa-badge',
|
||||||
"color": "bg-success",
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
"badge_remove":{
|
'badge_remove': {
|
||||||
"str": 'removed badge from {self.target_link}',
|
"str": 'removed badge from {self.target_link}',
|
||||||
"icon": "fa-badge",
|
"icon": 'fa-badge',
|
||||||
"color": "bg-danger",
|
"color": 'bg-danger'
|
||||||
},
|
},
|
||||||
"link_accounts":{
|
'ban_comment': {
|
||||||
"str": 'linked {self.target_link}',
|
"str": 'removed {self.target_link}',
|
||||||
"icon":"fa-link",
|
"icon": 'fa-comment',
|
||||||
"color": "bg-success",
|
"color": 'bg-danger'
|
||||||
},
|
},
|
||||||
"distinguish_comment":{
|
'ban_domain': {
|
||||||
|
"str": 'banned a domain',
|
||||||
|
"icon": 'fa-globe',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'ban_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',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'change_sidebar': {
|
||||||
|
"str": 'changed the sidebar',
|
||||||
|
"icon": 'fa-columns',
|
||||||
|
"color": 'bg-primary'
|
||||||
|
},
|
||||||
|
'check': {
|
||||||
|
"str": 'gave {self.target_link} a checkmark',
|
||||||
|
"icon": 'fa-badge-check',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'club_allow': {
|
||||||
|
"str": 'allowed user {self.target_link} into the {cc}',
|
||||||
|
"icon": 'fa-golf-club',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'club_ban': {
|
||||||
|
"str": 'disallowed user {self.target_link} from the {cc}',
|
||||||
|
"icon": 'fa-golf-club',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'delete_report': {
|
||||||
|
"str": 'deleted report on {self.target_link}',
|
||||||
|
"icon": 'fa-flag',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'disable_signups': {
|
||||||
|
"str": 'disabled signups',
|
||||||
|
"icon": 'fa-users',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'disable_under_attack': {
|
||||||
|
"str": 'disabled under attack mode',
|
||||||
|
"icon": 'fa-shield',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'distinguish_comment': {
|
||||||
"str": 'distinguished their {self.target_link}',
|
"str": 'distinguished their {self.target_link}',
|
||||||
"icon": "fa-crown",
|
"icon": 'fa-crown',
|
||||||
"color": "bg-success"
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
"distinguish_post":{
|
'distinguish_post': {
|
||||||
"str": 'distinguished their post {self.target_link}',
|
"str": 'distinguished their post {self.target_link}',
|
||||||
"icon": "fa-crown",
|
"icon": 'fa-crown',
|
||||||
"color": "bg-success"
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
"undistinguish_comment":{
|
'distribute': {
|
||||||
|
"str": 'distributed bet winnings to voters on {self.target_link}',
|
||||||
|
"icon": 'fa-dollar-sign',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'dump_cache': {
|
||||||
|
"str": 'dumped cache',
|
||||||
|
"icon": 'fa-trash-alt',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'enable_signups': {
|
||||||
|
"str": 'enabled signups',
|
||||||
|
"icon": 'fa-users',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'enable_under_attack': {
|
||||||
|
"str": 'enabled under attack mode',
|
||||||
|
"icon": 'fa-shield',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'grant_awards': {
|
||||||
|
"str": 'granted awards to {self.target_link}',
|
||||||
|
"icon": 'fa-gift',
|
||||||
|
"color": 'bg-primary'
|
||||||
|
},
|
||||||
|
'link_accounts': {
|
||||||
|
"str": 'linked {self.target_link}',
|
||||||
|
"icon": 'fa-link',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'make_admin': {
|
||||||
|
"str": 'made {self.target_link} admin',
|
||||||
|
"icon": 'fa-user-crown',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'make_meme_admin': {
|
||||||
|
"str": 'made {self.target_link} meme admin',
|
||||||
|
"icon": 'fa-user-crown',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'monthly': {
|
||||||
|
"str": 'distributed monthly marseybux',
|
||||||
|
"icon": 'fa-sack-dollar',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'nuke_user': {
|
||||||
|
"str": 'removed all content of {self.target_link}',
|
||||||
|
"icon": 'fa-radiation-alt',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'pin_comment': {
|
||||||
|
"str": 'pinned a {self.target_link}',
|
||||||
|
"icon": 'fa-thumbtack fa-rotate--45',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'pin_post': {
|
||||||
|
"str": 'pinned post {self.target_link}',
|
||||||
|
"icon": 'fa-thumbtack fa-rotate--45',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'purge_cache': {
|
||||||
|
"str": 'purged cache',
|
||||||
|
"icon": 'fa-memory',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'reject_app': {
|
||||||
|
"str": 'rejected an application request by {self.target_link}',
|
||||||
|
"icon": 'fa-robot',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'remove_admin': {
|
||||||
|
"str": 'removed {self.target_link} as admin',
|
||||||
|
"icon": 'fa-user-crown',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'remove_meme_admin': {
|
||||||
|
"str": 'removed {self.target_link} as meme admin',
|
||||||
|
"icon": 'fa-user-crown',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'revert': {
|
||||||
|
"str": 'reverted {self.target_link} mod actions',
|
||||||
|
"icon": 'fa-history',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'revoke_app': {
|
||||||
|
"str": 'revoked an application by {self.target_link}',
|
||||||
|
"icon": 'fa-robot',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'set_flair_locked': {
|
||||||
|
"str": "set {self.target_link}'s flair (locked)",
|
||||||
|
"icon": 'fa-award',
|
||||||
|
"color": 'bg-primary'
|
||||||
|
},
|
||||||
|
'set_flair_notlocked': {
|
||||||
|
"str": "set {self.target_link}'s flair (not locked)",
|
||||||
|
"icon": 'fa-award',
|
||||||
|
"color": 'bg-primary'
|
||||||
|
},
|
||||||
|
'set_nsfw': {
|
||||||
|
"str": 'set nsfw on post {self.target_link}',
|
||||||
|
"icon": 'fa-eye-evil',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'shadowban': {
|
||||||
|
"str": 'shadowbanned {self.target_link}',
|
||||||
|
"icon": 'fa-eye-slash',
|
||||||
|
"color": 'bg-danger'
|
||||||
|
},
|
||||||
|
'unagendaposter': {
|
||||||
|
"str": 'removed chud theme from {self.target_link}',
|
||||||
|
"icon": 'fa-snooze',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'unban_comment': {
|
||||||
|
"str": 'reinstated {self.target_link}',
|
||||||
|
"icon": 'fa-comment',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'unban_domain': {
|
||||||
|
"str": 'unbanned a domain',
|
||||||
|
"icon": 'fa-globe',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'unban_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',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'uncheck': {
|
||||||
|
"str": 'removed checkmark from {self.target_link}',
|
||||||
|
"icon": 'fa-badge-check',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'undistinguish_comment': {
|
||||||
"str": 'un-distinguished their {self.target_link}',
|
"str": 'un-distinguished their {self.target_link}',
|
||||||
"icon": "fa-crown",
|
"icon": 'fa-crown',
|
||||||
"color": "bg-muted"
|
"color": 'bg-muted'
|
||||||
},
|
},
|
||||||
"undistinguish_post":{
|
'undistinguish_post': {
|
||||||
"str": 'un-distinguished their post {self.target_link}',
|
"str": 'un-distinguished their post {self.target_link}',
|
||||||
"icon": "fa-crown",
|
"icon": 'fa-crown',
|
||||||
"color": "bg-muted"
|
"color": 'bg-muted'
|
||||||
},
|
},
|
||||||
|
'unnuke_user': {
|
||||||
|
"str": 'approved all content of {self.target_link}',
|
||||||
|
"icon": 'fa-radiation-alt',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'unpin_comment': {
|
||||||
|
"str": 'un-pinned a {self.target_link}',
|
||||||
|
"icon": 'fa-thumbtack fa-rotate--45',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'unpin_post': {
|
||||||
|
"str": 'un-pinned post {self.target_link}',
|
||||||
|
"icon": 'fa-thumbtack fa-rotate--45',
|
||||||
|
"color": 'bg-muted'
|
||||||
|
},
|
||||||
|
'unset_nsfw': {
|
||||||
|
"str": 'un-set nsfw on post {self.target_link}',
|
||||||
|
"icon": 'fa-eye-evil',
|
||||||
|
"color": 'bg-success'
|
||||||
|
},
|
||||||
|
'unshadowban': {
|
||||||
|
"str": 'unshadowbanned {self.target_link}',
|
||||||
|
"icon": 'fa-eye',
|
||||||
|
"color": 'bg-success'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ACTIONTYPES = {key: value for key, value in sorted(ACTIONTYPES.items())}
|
||||||
|
print(ACTIONTYPES, flush=True)
|
||||||
|
|
||||||
ACTIONTYPES2 = deepcopy(ACTIONTYPES)
|
ACTIONTYPES2 = deepcopy(ACTIONTYPES)
|
||||||
ACTIONTYPES2.pop("shadowban")
|
ACTIONTYPES2.pop("shadowban")
|
||||||
|
|
|
@ -664,6 +664,8 @@ choice_regex = re.compile("\s*&&([^\$\n]+)&&\s*", flags=re.A)
|
||||||
|
|
||||||
embed_removing_regex = re.compile('!\[\]\((.*?)\)', flags=re.A)
|
embed_removing_regex = re.compile('!\[\]\((.*?)\)', flags=re.A)
|
||||||
|
|
||||||
|
image_check_regex = re.compile('!\[\]\(((?![^?\n]*\.(png|jpg|jpeg|gif|webp)).*?)\)', flags=re.I|re.A)
|
||||||
|
|
||||||
title_regex = re.compile("[^\w ]", flags=re.A)
|
title_regex = re.compile("[^\w ]", flags=re.A)
|
||||||
|
|
||||||
based_regex = re.compile("based and (.{1,20}?)(-| )pilled", flags=re.I|re.A)
|
based_regex = re.compile("based and (.{1,20}?)(-| )pilled", flags=re.I|re.A)
|
||||||
|
|
|
@ -111,6 +111,8 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
||||||
signal.signal(signal.SIGALRM, handler)
|
signal.signal(signal.SIGALRM, handler)
|
||||||
signal.alarm(1)
|
signal.alarm(1)
|
||||||
|
|
||||||
|
sanitized = image_check_regex.sub(r'\1', sanitized)
|
||||||
|
|
||||||
sanitized = markdown(sanitized)
|
sanitized = markdown(sanitized)
|
||||||
|
|
||||||
sanitized = strikethrough_regex.sub(r'<del>\1</del>', sanitized)
|
sanitized = strikethrough_regex.sub(r'<del>\1</del>', sanitized)
|
||||||
|
|
|
@ -235,7 +235,13 @@ def log(v):
|
||||||
if not (v and v.admin_level > 1):
|
if not (v and v.admin_level > 1):
|
||||||
actions = actions.filter(ModAction.kind.notin_(["shadowban","unshadowban"]))
|
actions = actions.filter(ModAction.kind.notin_(["shadowban","unshadowban"]))
|
||||||
|
|
||||||
if admin_id: actions = actions.filter_by(user_id=admin_id)
|
if admin_id:
|
||||||
|
actions = actions.filter_by(user_id=admin_id)
|
||||||
|
kinds = set([x.kind for x in actions])
|
||||||
|
types2 = {}
|
||||||
|
for k,val in types.items():
|
||||||
|
if k in kinds: types2[k] = val
|
||||||
|
types = types2
|
||||||
if kind: actions = actions.filter_by(kind=kind)
|
if kind: actions = actions.filter_by(kind=kind)
|
||||||
|
|
||||||
actions = actions.order_by(ModAction.id.desc()).offset(25*(page-1)).limit(26).all()
|
actions = actions.order_by(ModAction.id.desc()).offset(25*(page-1)).limit(26).all()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue