aa-bb 3.2.4b4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aa_bb/__init__.py +4 -0
- aa_bb/admin.py +475 -0
- aa_bb/app_settings.py +1536 -0
- aa_bb/apps.py +68 -0
- aa_bb/auth_hooks.py +191 -0
- aa_bb/celery.py +63 -0
- aa_bb/checks/__init__.py +8 -0
- aa_bb/checks/add_to_blacklist.py +190 -0
- aa_bb/checks/alliance_blacklist.py +21 -0
- aa_bb/checks/alpha_skills.json +757 -0
- aa_bb/checks/awox.py +371 -0
- aa_bb/checks/clone_state.py +304 -0
- aa_bb/checks/coalition_blacklist.py +19 -0
- aa_bb/checks/corp_changes.py +257 -0
- aa_bb/checks/cyno.py +377 -0
- aa_bb/checks/hostile_assets.py +439 -0
- aa_bb/checks/hostile_clones.py +504 -0
- aa_bb/checks/roles_and_tokens.py +209 -0
- aa_bb/checks/skills.json +659 -0
- aa_bb/checks/skills.py +289 -0
- aa_bb/checks/sus_contacts.py +286 -0
- aa_bb/checks/sus_contracts.py +258 -0
- aa_bb/checks/sus_mails.py +381 -0
- aa_bb/checks/sus_trans.py +597 -0
- aa_bb/checks_cb/__init__.py +7 -0
- aa_bb/checks_cb/hostile_assets.py +160 -0
- aa_bb/checks_cb/sus_contracts.py +277 -0
- aa_bb/checks_cb/sus_trans.py +523 -0
- aa_bb/esi_cache.py +39 -0
- aa_bb/esi_client.py +75 -0
- aa_bb/forms.py +52 -0
- aa_bb/locale/.gitkeep +0 -0
- aa_bb/management/__init__.py +0 -0
- aa_bb/management/commands/__init__.py +0 -0
- aa_bb/migrations/0001_initial.py +25 -0
- aa_bb/migrations/0002_bigbrotherconfig_userstatus.py +58 -0
- aa_bb/migrations/0003_alter_bigbrotherconfig_pingroleid.py +18 -0
- aa_bb/migrations/0004_alter_bigbrotherconfig_is_active_and_more.py +23 -0
- aa_bb/migrations/0005_alter_bigbrotherconfig_hostile_alliances.py +18 -0
- aa_bb/migrations/0006_alter_bigbrotherconfig_pingroleid.py +18 -0
- aa_bb/migrations/0007_alter_general_options.py +17 -0
- aa_bb/migrations/0008_alliance_names_corporation_names.py +41 -0
- aa_bb/migrations/0009_userstatus_sus_contacts_userstatus_sus_contracts_and_more.py +38 -0
- aa_bb/migrations/0010_alter_userstatus_awox_kill_links_and_more.py +48 -0
- aa_bb/migrations/0011_character_names.py +27 -0
- aa_bb/migrations/0012_id_types.py +27 -0
- aa_bb/migrations/0013_bigbrotherconfig_mail_keywords.py +18 -0
- aa_bb/migrations/0014_processedcontract_processedmail_and_more.py +74 -0
- aa_bb/migrations/0015_processedtransaction_sustransactionnote.py +42 -0
- aa_bb/migrations/0016_warmprogress.py +23 -0
- aa_bb/migrations/0017_entityinfocache.py +27 -0
- aa_bb/migrations/0018_userstatus_cyno_userstatus_has_skills_and_more.py +28 -0
- aa_bb/migrations/0019_bigbrotherconfig_whitelist_alliances_and_more.py +23 -0
- aa_bb/migrations/0020_messages_bigbrotherconfig_are_daily_messages_active_and_more.py +35 -0
- aa_bb/migrations/0021_alter_messages_id_alter_messages_text.py +23 -0
- aa_bb/migrations/0022_messages_sent_in_cycle.py +18 -0
- aa_bb/migrations/0023_optmessages1_optmessages2_optmessages3_optmessages4_and_more.py +103 -0
- aa_bb/migrations/0024_bigbrotherconfig_dailyschedule_and_more.py +45 -0
- aa_bb/migrations/0025_alter_messages_options_alter_optmessages1_options_and_more.py +37 -0
- aa_bb/migrations/0026_alter_general_options_alter_bigbrotherconfig_id_and_more.py +97 -0
- aa_bb/migrations/0027_alter_general_options_bigbrotherconfig_is_loa_active_and_more.py +27 -0
- aa_bb/migrations/0028_alter_bigbrotherconfig_is_loa_active.py +18 -0
- aa_bb/migrations/0029_leaverequest_main_character.py +18 -0
- aa_bb/migrations/0030_alter_general_options.py +17 -0
- aa_bb/migrations/0031_bigbrotherconfig_loa_max_logoff_days_and_more.py +88 -0
- aa_bb/migrations/0032_alter_leaverequest_status.py +18 -0
- aa_bb/migrations/0033_messagetype_bigbrotherconfig_pingroleid2_and_more.py +45 -0
- aa_bb/migrations/0034_rename_last_updated_userstatus_updated.py +18 -0
- aa_bb/migrations/0035_alter_userstatus_options.py +17 -0
- aa_bb/migrations/0036_alter_general_options.py +17 -0
- aa_bb/migrations/0037_corpstatus.py +32 -0
- aa_bb/migrations/0038_bigbrotherconfig_ignored_corporations.py +18 -0
- aa_bb/migrations/0039_alter_bigbrotherconfig_ignored_corporations.py +18 -0
- aa_bb/migrations/0040_sovereigntymapcache_corporationinfocache_and_more.py +49 -0
- aa_bb/migrations/0041_bigbrotherconfig_is_warmer_active.py +18 -0
- aa_bb/migrations/0042_alter_general_options_and_more.py +23 -0
- aa_bb/migrations/0043_bigbrotherconfig_bb_member_states_and_more.py +24 -0
- aa_bb/migrations/0044_bigbrotherconfig_character_scopes_and_more.py +23 -0
- aa_bb/migrations/0045_userstatus_sp_age_ratio_result.py +18 -0
- aa_bb/migrations/0046_bigbrotherconfig_member_corporations.py +18 -0
- aa_bb/migrations/0047_bigbrotherconfig_member_alliances.py +18 -0
- aa_bb/migrations/0048_characteraccountstate.py +21 -0
- aa_bb/migrations/0049_userstatus_clone_status.py +18 -0
- aa_bb/migrations/0050_alter_general_options_and_more.py +22 -0
- aa_bb/migrations/0051_monthlypapstats.py +34 -0
- aa_bb/migrations/0052_papsconfig_delete_monthlypapstats.py +30 -0
- aa_bb/migrations/0053_alter_papsconfig_corp_modifier_and_more.py +38 -0
- aa_bb/migrations/0054_alter_general_options.py +17 -0
- aa_bb/migrations/0055_papsconfig_group_paps_papsconfig_group_paps_modifier.py +24 -0
- aa_bb/migrations/0056_alter_papsconfig_group_paps.py +19 -0
- aa_bb/migrations/0057_papsconfig_excluded_groups_papsconfig_excluded_users_and_more.py +31 -0
- aa_bb/migrations/0058_papsconfig_excluded_groups_get_paps_and_more.py +30 -0
- aa_bb/migrations/0059_alter_papsconfig_excluded_groups_get_paps.py +18 -0
- aa_bb/migrations/0060_papsconfig_cap_group_papsconfig_cap_group_paps_and_more.py +49 -0
- aa_bb/migrations/0061_remove_papsconfig_cap_group_and_more.py +42 -0
- aa_bb/migrations/0062_complianceticket.py +28 -0
- aa_bb/migrations/0063_alter_complianceticket_user.py +21 -0
- aa_bb/migrations/0064_alter_complianceticket_reason.py +18 -0
- aa_bb/migrations/0065_alter_complianceticket_reason_and_more.py +26 -0
- aa_bb/migrations/0066_tickettoolconfig_papcompliance.py +53 -0
- aa_bb/migrations/0067_remove_tickettoolconfig_category_id_and_more.py +21 -0
- aa_bb/migrations/0068_tickettoolconfig_category_id_and_more.py +23 -0
- aa_bb/migrations/0069_tickettoolconfig_ticket_counter.py +18 -0
- aa_bb/migrations/0070_remove_tickettoolconfig_role_id_and_more.py +54 -0
- aa_bb/migrations/0071_tickettoolconfig_role_id.py +18 -0
- aa_bb/migrations/0072_alter_complianceticket_reason.py +18 -0
- aa_bb/migrations/0073_tickettoolconfig_starting_pap_compliance.py +18 -0
- aa_bb/migrations/0074_alter_bigbrotherconfig_hostile_alliances.py +18 -0
- aa_bb/migrations/0075_bbupdatestate_tickettoolconfig_afk_check_frequency_and_more.py +49 -0
- aa_bb/migrations/0076_id_types_last_accessed_frequentcorpchangescache_and_more.py +74 -0
- aa_bb/migrations/0077_complianceticket_ticket_id_and_more.py +28 -0
- aa_bb/migrations/0078_tickettoolconfig_awox_monitor_enabled.py +18 -0
- aa_bb/migrations/0079_helptext_guidance.py +57 -0
- aa_bb/migrations/0080_bigbrotherconfig_dlc_flags.py +65 -0
- aa_bb/migrations/0081_remove_papsconfig_imp_modifier_and_more.py +56 -0
- aa_bb/migrations/0082_remove_bigbrotherconfig_token_and_more.py +82 -0
- aa_bb/migrations/0083_alter_bigbrotherredditmessage_options_and_more.py +71 -0
- aa_bb/migrations/0084_bigbrotherconfig_consider_all_structures_hostile_and_more.py +43 -0
- aa_bb/migrations/0085_bigbrotherconfig_awox_notify_and_more.py +33 -0
- aa_bb/migrations/0086_bigbrotherconfig_are_recurring_stats_active_and_more.py +54 -0
- aa_bb/migrations/0087_bigbrotherconfig_dlc_are_recurring_stats_active.py +18 -0
- aa_bb/migrations/0088_bigbrotherconfig_cyno_notify.py +18 -0
- aa_bb/migrations/0089_bigbrotherconfig_asset_notify_and_more.py +58 -0
- aa_bb/migrations/0090_alter_papsconfig_options_and_more.py +488 -0
- aa_bb/migrations/0091_remove_bigbrotherconfig_dlc_are_recurring_stats_active_and_more.py +62 -0
- aa_bb/migrations/0092_userstatus_baseline_initialized.py +28 -0
- aa_bb/migrations/0093_eveitemprice_delete_bigbrotherredditmessage_and_more.py +154 -0
- aa_bb/migrations/0094_bigbrotherconfig_corp_compliance_webhook_and_more.py +28 -0
- aa_bb/migrations/0095_alter_bigbrotherconfig_limit_to_main_corp.py +18 -0
- aa_bb/migrations/__init__.py +0 -0
- aa_bb/models.py +2030 -0
- aa_bb/signals.py +81 -0
- aa_bb/static/aa_bb/.gitkeep +0 -0
- aa_bb/static/aa_bb/js/admin_market_toggle.js +21 -0
- aa_bb/tasks.py +1449 -0
- aa_bb/tasks_bot.py +314 -0
- aa_bb/tasks_cb.py +929 -0
- aa_bb/tasks_ct.py +366 -0
- aa_bb/tasks_other.py +290 -0
- aa_bb/tasks_tickets.py +472 -0
- aa_bb/tasks_utils.py +328 -0
- aa_bb/templates/aa_bb/base.html +25 -0
- aa_bb/templates/aa_bb/disabled.html +20 -0
- aa_bb/templates/aa_bb/index.html +555 -0
- aa_bb/templates/aa_cb/base.html +26 -0
- aa_bb/templates/aa_cb/disabled.html +20 -0
- aa_bb/templates/aa_cb/index.html +398 -0
- aa_bb/templates/faq/base.html +19 -0
- aa_bb/templates/faq/cards.html +115 -0
- aa_bb/templates/faq/faq.html +531 -0
- aa_bb/templates/faq/menu.html +30 -0
- aa_bb/templates/faq/modules.html +66 -0
- aa_bb/templates/faq/settings_bigbrother.html +355 -0
- aa_bb/templates/faq/settings_nav.html +47 -0
- aa_bb/templates/faq/settings_paps.html +132 -0
- aa_bb/templates/faq/settings_stats.html +116 -0
- aa_bb/templates/faq/settings_tickets.html +226 -0
- aa_bb/templates/loa/_loa_subtabs.html +17 -0
- aa_bb/templates/loa/admin.html +113 -0
- aa_bb/templates/loa/base.html +22 -0
- aa_bb/templates/loa/disabled.html +19 -0
- aa_bb/templates/loa/index.html +62 -0
- aa_bb/templates/loa/menu.html +27 -0
- aa_bb/templates/loa/request.html +81 -0
- aa_bb/templates/paps/base.html +21 -0
- aa_bb/templates/paps/disabled.html +19 -0
- aa_bb/templates/paps/history.html +25 -0
- aa_bb/templates/paps/index.html +86 -0
- aa_bb/templates/paps/menu.html +20 -0
- aa_bb/tests/__init__.py +1 -0
- aa_bb/tests/test_clone_state_logic.py +75 -0
- aa_bb/tests/test_performance.py +129 -0
- aa_bb/tests/test_price_timer.py +62 -0
- aa_bb/tests/test_task_setup.py +83 -0
- aa_bb/tests/test_tasks_notifications.py +70 -0
- aa_bb/tests/test_views.py +203 -0
- aa_bb/urls.py +56 -0
- aa_bb/urls_cb.py +27 -0
- aa_bb/urls_loa.py +14 -0
- aa_bb/urls_paps.py +10 -0
- aa_bb/views.py +1213 -0
- aa_bb/views_cb.py +724 -0
- aa_bb/views_faq.py +577 -0
- aa_bb/views_paps.py +342 -0
- aa_bb-3.2.4b4.dist-info/METADATA +454 -0
- aa_bb-3.2.4b4.dist-info/RECORD +188 -0
- aa_bb-3.2.4b4.dist-info/WHEEL +4 -0
- aa_bb-3.2.4b4.dist-info/licenses/LICENSE +7 -0
aa_bb/__init__.py
ADDED
aa_bb/admin.py
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Admin registrations for every BigBrother-related model.
|
|
3
|
+
|
|
4
|
+
Most models are singletons that gate optional modules. The helpers below
|
|
5
|
+
ensure their admin entries only appear when the relevant feature is enabled
|
|
6
|
+
and prevent accidental multi-row creation of what should be one-off configs.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from solo.admin import SingletonModelAdmin
|
|
10
|
+
|
|
11
|
+
from django.contrib import admin
|
|
12
|
+
from .app_settings import afat_active
|
|
13
|
+
from django.contrib.admin.sites import NotRegistered
|
|
14
|
+
|
|
15
|
+
from .models import (
|
|
16
|
+
BigBrotherConfig,
|
|
17
|
+
Messages,
|
|
18
|
+
OptMessages1,
|
|
19
|
+
OptMessages2,
|
|
20
|
+
OptMessages3,
|
|
21
|
+
OptMessages4,
|
|
22
|
+
OptMessages5,
|
|
23
|
+
UserStatus,
|
|
24
|
+
WarmProgress,
|
|
25
|
+
PapsConfig,
|
|
26
|
+
RecurringStatsConfig,
|
|
27
|
+
AA_CONTACTS_INSTALLED,
|
|
28
|
+
TicketToolConfig,
|
|
29
|
+
PapCompliance,
|
|
30
|
+
LeaveRequest,
|
|
31
|
+
ComplianceTicket,
|
|
32
|
+
EveItemPrice,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
@admin.register(BigBrotherConfig)
|
|
36
|
+
class BB_ConfigAdmin(SingletonModelAdmin):
|
|
37
|
+
fieldsets = (
|
|
38
|
+
(
|
|
39
|
+
"Core Activation",
|
|
40
|
+
{
|
|
41
|
+
"fields": (
|
|
42
|
+
"is_active",
|
|
43
|
+
"is_warmer_active",
|
|
44
|
+
"is_loa_active",
|
|
45
|
+
"is_paps_active",
|
|
46
|
+
"are_daily_messages_active",
|
|
47
|
+
"are_recurring_stats_active",
|
|
48
|
+
"are_opt_messages1_active",
|
|
49
|
+
"are_opt_messages2_active",
|
|
50
|
+
"are_opt_messages3_active",
|
|
51
|
+
"are_opt_messages4_active",
|
|
52
|
+
"are_opt_messages5_active",
|
|
53
|
+
"loa_max_logoff_days",
|
|
54
|
+
)
|
|
55
|
+
},
|
|
56
|
+
),
|
|
57
|
+
(
|
|
58
|
+
"Notifications",
|
|
59
|
+
{
|
|
60
|
+
"fields": (
|
|
61
|
+
"ct_notify",
|
|
62
|
+
"awox_notify",
|
|
63
|
+
"cyno_notify",
|
|
64
|
+
"sp_inject_notify",
|
|
65
|
+
"clone_notify",
|
|
66
|
+
"asset_notify",
|
|
67
|
+
"contact_notify",
|
|
68
|
+
"contract_notify",
|
|
69
|
+
"mail_notify",
|
|
70
|
+
"transaction_notify",
|
|
71
|
+
"show_market_transactions",
|
|
72
|
+
"new_user_notify",
|
|
73
|
+
),
|
|
74
|
+
},
|
|
75
|
+
),
|
|
76
|
+
(
|
|
77
|
+
"Update Performance",
|
|
78
|
+
{
|
|
79
|
+
"fields": (
|
|
80
|
+
"clone_state_always_recheck",
|
|
81
|
+
"update_stagger_seconds",
|
|
82
|
+
"update_cache_ttl_hours",
|
|
83
|
+
"update_maintenance_window_start",
|
|
84
|
+
"update_maintenance_window_end",
|
|
85
|
+
"update_backlog_threshold",
|
|
86
|
+
"update_backlog_notify",
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
),
|
|
90
|
+
(
|
|
91
|
+
"Market Transaction Settings",
|
|
92
|
+
{
|
|
93
|
+
"classes": ("market-transaction-settings-fieldset",),
|
|
94
|
+
"fields": (
|
|
95
|
+
"market_transactions_show_major_hubs",
|
|
96
|
+
"market_transactions_show_secondary_hubs",
|
|
97
|
+
"market_transactions_excluded_systems",
|
|
98
|
+
"market_transactions_threshold_alert",
|
|
99
|
+
"market_transactions_threshold_percent",
|
|
100
|
+
"market_transactions_price_method",
|
|
101
|
+
"market_transactions_janice_api_key",
|
|
102
|
+
"market_transactions_fuzzwork_station_id",
|
|
103
|
+
"market_transactions_price_instant",
|
|
104
|
+
"market_transactions_price_max_age",
|
|
105
|
+
)
|
|
106
|
+
},
|
|
107
|
+
),
|
|
108
|
+
(
|
|
109
|
+
"Blacklist Settings",
|
|
110
|
+
{
|
|
111
|
+
"fields": (
|
|
112
|
+
"alliance_blacklist_url",
|
|
113
|
+
"external_blacklist_url",
|
|
114
|
+
)
|
|
115
|
+
},
|
|
116
|
+
),
|
|
117
|
+
(
|
|
118
|
+
"Ping / Messaging Roles",
|
|
119
|
+
{
|
|
120
|
+
"fields": (
|
|
121
|
+
"pingroleID",
|
|
122
|
+
"pingroleID2",
|
|
123
|
+
"pingrole1_messages",
|
|
124
|
+
"pingrole2_messages",
|
|
125
|
+
"here_messages",
|
|
126
|
+
"everyone_messages",
|
|
127
|
+
)
|
|
128
|
+
},
|
|
129
|
+
),
|
|
130
|
+
(
|
|
131
|
+
"Webhooks",
|
|
132
|
+
{
|
|
133
|
+
"fields": (
|
|
134
|
+
"webhook",
|
|
135
|
+
"loawebhook",
|
|
136
|
+
"dailywebhook",
|
|
137
|
+
"optwebhook1",
|
|
138
|
+
"optwebhook2",
|
|
139
|
+
"optwebhook3",
|
|
140
|
+
"optwebhook4",
|
|
141
|
+
"optwebhook5",
|
|
142
|
+
"user_compliance_webhook",
|
|
143
|
+
"corp_compliance_webhook",
|
|
144
|
+
"stats_webhook",
|
|
145
|
+
)
|
|
146
|
+
},
|
|
147
|
+
),
|
|
148
|
+
(
|
|
149
|
+
"Schedules",
|
|
150
|
+
{
|
|
151
|
+
"fields": (
|
|
152
|
+
"dailyschedule",
|
|
153
|
+
"optschedule1",
|
|
154
|
+
"optschedule2",
|
|
155
|
+
"optschedule3",
|
|
156
|
+
"optschedule4",
|
|
157
|
+
"optschedule5",
|
|
158
|
+
"stats_schedule",
|
|
159
|
+
),
|
|
160
|
+
},
|
|
161
|
+
),
|
|
162
|
+
(
|
|
163
|
+
"User State & Membership",
|
|
164
|
+
{
|
|
165
|
+
"fields": (
|
|
166
|
+
"limit_to_main_corp",
|
|
167
|
+
"bb_guest_states",
|
|
168
|
+
"bb_member_states",
|
|
169
|
+
"member_corporations",
|
|
170
|
+
"member_alliances",
|
|
171
|
+
"ignored_corporations",
|
|
172
|
+
)
|
|
173
|
+
},
|
|
174
|
+
),
|
|
175
|
+
(
|
|
176
|
+
"Hostile / Whitelist Rules",
|
|
177
|
+
{
|
|
178
|
+
"fields": (
|
|
179
|
+
"hostile_alliances",
|
|
180
|
+
"hostile_corporations",
|
|
181
|
+
"whitelist_alliances",
|
|
182
|
+
"whitelist_corporations",
|
|
183
|
+
"consider_nullsec_hostile",
|
|
184
|
+
"consider_all_structures_hostile",
|
|
185
|
+
"consider_npc_stations_hostile",
|
|
186
|
+
"excluded_systems",
|
|
187
|
+
"excluded_stations",
|
|
188
|
+
"hostile_assets_ships_only",
|
|
189
|
+
# aa-contacts import (conditionally add fields)
|
|
190
|
+
*(
|
|
191
|
+
(
|
|
192
|
+
"auto_import_contacts_enabled",
|
|
193
|
+
"contacts_source_alliances",
|
|
194
|
+
"contacts_source_corporations",
|
|
195
|
+
"contacts_handle_neutrals",
|
|
196
|
+
)
|
|
197
|
+
if AA_CONTACTS_INSTALLED
|
|
198
|
+
else ()
|
|
199
|
+
),
|
|
200
|
+
)
|
|
201
|
+
},
|
|
202
|
+
),
|
|
203
|
+
(
|
|
204
|
+
"Scopes",
|
|
205
|
+
{
|
|
206
|
+
"classes": ("collapse",),
|
|
207
|
+
"fields": (
|
|
208
|
+
"character_scopes",
|
|
209
|
+
"corporation_scopes",
|
|
210
|
+
),
|
|
211
|
+
},
|
|
212
|
+
),
|
|
213
|
+
(
|
|
214
|
+
"Main Corp / Alliance",
|
|
215
|
+
{
|
|
216
|
+
"fields": (
|
|
217
|
+
"main_corporation_id",
|
|
218
|
+
"main_corporation",
|
|
219
|
+
"main_alliance_id",
|
|
220
|
+
"main_alliance",
|
|
221
|
+
),
|
|
222
|
+
},
|
|
223
|
+
),
|
|
224
|
+
)
|
|
225
|
+
"""Singleton config for the core BigBrother module."""
|
|
226
|
+
readonly_fields = (
|
|
227
|
+
"main_corporation",
|
|
228
|
+
"main_alliance",
|
|
229
|
+
"main_corporation_id",
|
|
230
|
+
"main_alliance_id",
|
|
231
|
+
"is_active",
|
|
232
|
+
"update_last_dispatch_count",
|
|
233
|
+
)
|
|
234
|
+
filter_horizontal = (
|
|
235
|
+
"pingrole1_messages",
|
|
236
|
+
"pingrole2_messages",
|
|
237
|
+
"here_messages",
|
|
238
|
+
"everyone_messages",
|
|
239
|
+
"bb_guest_states",
|
|
240
|
+
"bb_member_states",
|
|
241
|
+
# aa-contacts M2M (only if installed)
|
|
242
|
+
*(
|
|
243
|
+
("contacts_source_alliances", "contacts_source_corporations")
|
|
244
|
+
if AA_CONTACTS_INSTALLED
|
|
245
|
+
else ()
|
|
246
|
+
),
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
class Media:
|
|
250
|
+
js = ("aa_bb/js/admin_market_toggle.js",)
|
|
251
|
+
|
|
252
|
+
def has_add_permission(self, request):
|
|
253
|
+
"""Prevent duplicate singleton rows."""
|
|
254
|
+
if BigBrotherConfig.objects.exists(): # Disallow when a config already exists.
|
|
255
|
+
return False
|
|
256
|
+
return super().has_add_permission(request)
|
|
257
|
+
|
|
258
|
+
def has_delete_permission(self, request, obj=None):
|
|
259
|
+
"""Always allow deleting to keep parity with default behavior."""
|
|
260
|
+
return True
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
@admin.register(PapsConfig)
|
|
264
|
+
class PapsConfigAdmin(SingletonModelAdmin):
|
|
265
|
+
"""Controls PAP multipliers/thresholds; singleton per installation."""
|
|
266
|
+
filter_horizontal = (
|
|
267
|
+
"group_paps",
|
|
268
|
+
"excluded_groups",
|
|
269
|
+
"excluded_users",
|
|
270
|
+
"excluded_users_paps",
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
def has_add_permission(self, request):
|
|
274
|
+
"""Prevent duplicate PAP config entries."""
|
|
275
|
+
if PapsConfig.objects.exists(): # Disallow singleton duplication.
|
|
276
|
+
return False
|
|
277
|
+
return super().has_add_permission(request)
|
|
278
|
+
|
|
279
|
+
def has_delete_permission(self, request, obj=None):
|
|
280
|
+
"""Allow deletes so admins can rebuild the configuration."""
|
|
281
|
+
return True
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
@admin.register(TicketToolConfig)
|
|
285
|
+
class TicketToolConfigAdmin(SingletonModelAdmin):
|
|
286
|
+
"""Ticket automation thresholds + templates."""
|
|
287
|
+
filter_horizontal = (
|
|
288
|
+
"excluded_users",
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
def has_add_permission(self, request):
|
|
292
|
+
"""Prevent duplicate ticket config entries."""
|
|
293
|
+
if TicketToolConfig.objects.exists(): # Ticket config should remain singleton.
|
|
294
|
+
return False
|
|
295
|
+
return super().has_add_permission(request)
|
|
296
|
+
|
|
297
|
+
def has_delete_permission(self, request, obj=None):
|
|
298
|
+
"""Allow deletes when operators need to reset settings."""
|
|
299
|
+
return True
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
@admin.register(EveItemPrice)
|
|
305
|
+
class EveItemPriceAdmin(admin.ModelAdmin):
|
|
306
|
+
list_display = ("eve_type_id", "buy", "sell", "updated")
|
|
307
|
+
search_fields = ("eve_type_id",)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
@admin.register(Messages)
|
|
311
|
+
class DailyMessageConfig(admin.ModelAdmin):
|
|
312
|
+
"""Standard daily webhook messages rotated each cycle."""
|
|
313
|
+
search_fields = ["text"]
|
|
314
|
+
list_display = ["text", "sent_in_cycle"]
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
@admin.register(OptMessages1)
|
|
318
|
+
class OptMessage1Config(admin.ModelAdmin):
|
|
319
|
+
"""Optional webhook stream #1."""
|
|
320
|
+
search_fields = ["text"]
|
|
321
|
+
list_display = ["text", "sent_in_cycle"]
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
@admin.register(OptMessages2)
|
|
325
|
+
class OptMessage2Config(admin.ModelAdmin):
|
|
326
|
+
"""Optional webhook stream #2."""
|
|
327
|
+
search_fields = ["text"]
|
|
328
|
+
list_display = ["text", "sent_in_cycle"]
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
@admin.register(OptMessages3)
|
|
332
|
+
class OptMessage3Config(admin.ModelAdmin):
|
|
333
|
+
"""Optional webhook stream #3."""
|
|
334
|
+
search_fields = ["text"]
|
|
335
|
+
list_display = ["text", "sent_in_cycle"]
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
@admin.register(OptMessages4)
|
|
339
|
+
class OptMessage4Config(admin.ModelAdmin):
|
|
340
|
+
"""Optional webhook stream #4."""
|
|
341
|
+
search_fields = ["text"]
|
|
342
|
+
list_display = ["text", "sent_in_cycle"]
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
@admin.register(OptMessages5)
|
|
346
|
+
class OptMessage5Config(admin.ModelAdmin):
|
|
347
|
+
"""Optional webhook stream #5."""
|
|
348
|
+
search_fields = ["text"]
|
|
349
|
+
list_display = ["text", "sent_in_cycle"]
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
@admin.register(WarmProgress)
|
|
353
|
+
class WarmProgressConfig(admin.ModelAdmin):
|
|
354
|
+
"""Shows which users the cache warmer has processed recently."""
|
|
355
|
+
list_display = ["user_main", "updated"]
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
@admin.register(UserStatus)
|
|
359
|
+
class UserStatusConfig(admin.ModelAdmin):
|
|
360
|
+
"""Simple heartbeat for per-user card status."""
|
|
361
|
+
list_display = ["user", "updated"]
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
@admin.register(ComplianceTicket)
|
|
365
|
+
class ComplianceTicketConfig(admin.ModelAdmin):
|
|
366
|
+
"""History of tickets issued by the automation layer."""
|
|
367
|
+
list_display = ["user", "ticket_id", "reason"]
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
@admin.register(LeaveRequest)
|
|
371
|
+
class LeaveRequestConfig(admin.ModelAdmin):
|
|
372
|
+
"""Expose LeaveRequest records to staff when LoA is enabled."""
|
|
373
|
+
list_display = ["main_character", "start_date", "end_date", "reason", "status"]
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
@admin.register(PapCompliance)
|
|
377
|
+
class PapComplianceConfig(admin.ModelAdmin):
|
|
378
|
+
"""Shows the most recent PAP compliance calculation per user."""
|
|
379
|
+
search_fields = ["user_profile"]
|
|
380
|
+
list_display = ["user_profile", "pap_compliant"]
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
@admin.register(RecurringStatsConfig)
|
|
384
|
+
class RecurringStatsConfigAdmin(SingletonModelAdmin):
|
|
385
|
+
fieldsets = (
|
|
386
|
+
(
|
|
387
|
+
"General",
|
|
388
|
+
{
|
|
389
|
+
"fields": ("enabled",),
|
|
390
|
+
},
|
|
391
|
+
),
|
|
392
|
+
(
|
|
393
|
+
"States",
|
|
394
|
+
{
|
|
395
|
+
"fields": ("states",),
|
|
396
|
+
"description": "Select which states you want broken out (Member, Blue, Alumni, etc.).",
|
|
397
|
+
},
|
|
398
|
+
),
|
|
399
|
+
(
|
|
400
|
+
"Included Stats",
|
|
401
|
+
{
|
|
402
|
+
"fields": (
|
|
403
|
+
"include_auth_users",
|
|
404
|
+
"include_discord_users",
|
|
405
|
+
"include_mumble_users",
|
|
406
|
+
"include_characters",
|
|
407
|
+
"include_corporations",
|
|
408
|
+
"include_alliances",
|
|
409
|
+
"include_tokens",
|
|
410
|
+
"include_unique_tokens",
|
|
411
|
+
"include_character_audits",
|
|
412
|
+
"include_corporation_audits",
|
|
413
|
+
),
|
|
414
|
+
},
|
|
415
|
+
),
|
|
416
|
+
(
|
|
417
|
+
"Internal",
|
|
418
|
+
{
|
|
419
|
+
"fields": ("last_run_at", "last_snapshot"),
|
|
420
|
+
"classes": ("collapse",),
|
|
421
|
+
},
|
|
422
|
+
),
|
|
423
|
+
)
|
|
424
|
+
|
|
425
|
+
filter_horizontal = ("states",)
|
|
426
|
+
readonly_fields = ("last_run_at", "last_snapshot")
|
|
427
|
+
|
|
428
|
+
if not afat_active():
|
|
429
|
+
for _m in (PapsConfig, PapCompliance):
|
|
430
|
+
try:
|
|
431
|
+
admin.site.unregister(_m)
|
|
432
|
+
except NotRegistered:
|
|
433
|
+
pass
|
|
434
|
+
|
|
435
|
+
_PAP_OBJECT_NAMES = {"PapsConfig", "PapCompliance"}
|
|
436
|
+
_MARKET_OBJECT_NAMES = {"EveItemPrice", "ProcessedTransaction", "SusTransactionNote"}
|
|
437
|
+
_ORIG_GET_APP_LIST = admin.site.get_app_list
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
def _filtered_get_app_list(request, app_label=None):
|
|
441
|
+
app_list = _ORIG_GET_APP_LIST(request, app_label)
|
|
442
|
+
|
|
443
|
+
is_afat = afat_active()
|
|
444
|
+
config = BigBrotherConfig.get_solo()
|
|
445
|
+
show_market = getattr(config, "show_market_transactions", False)
|
|
446
|
+
|
|
447
|
+
filtered = []
|
|
448
|
+
for app in app_list:
|
|
449
|
+
label = app.get("app_label")
|
|
450
|
+
|
|
451
|
+
# Exclude AFAT's own admin section if present.
|
|
452
|
+
if not is_afat and label == "afat":
|
|
453
|
+
continue
|
|
454
|
+
|
|
455
|
+
# Filter models within our app
|
|
456
|
+
if label == "aa_bb":
|
|
457
|
+
models = app.get("models", [])
|
|
458
|
+
if not is_afat:
|
|
459
|
+
models = [
|
|
460
|
+
m for m in models if m.get("object_name") not in _PAP_OBJECT_NAMES
|
|
461
|
+
]
|
|
462
|
+
if not show_market:
|
|
463
|
+
models = [
|
|
464
|
+
m for m in models if m.get("object_name") not in _MARKET_OBJECT_NAMES
|
|
465
|
+
]
|
|
466
|
+
app = {**app, "models": models}
|
|
467
|
+
|
|
468
|
+
# Drop empty app groups
|
|
469
|
+
if app.get("models"):
|
|
470
|
+
filtered.append(app)
|
|
471
|
+
|
|
472
|
+
return filtered
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
admin.site.get_app_list = _filtered_get_app_list
|