Compare commits

...

216 Commits

Author SHA1 Message Date
Ariel Rin
8980d8d32f Version bump to 2.8.0 Stable 2020-10-13 05:33:54 +00:00
Ariel Rin
9d6cf9a62e Merge branch 'transifex' into 'master'
Add French and Japanese Translations + QoL Translation Fixes

See merge request allianceauth/allianceauth!1263
2020-10-13 04:17:37 +00:00
Ariel Rin
0fabb2b368 Add French and Japanese Translations + QoL Translation Fixes 2020-10-13 04:17:37 +00:00
Ariel Rin
9801ca0314 Merge branch 'emailoverrideredirect' into 'master'
Fix Redirect to dashboard if not verifying email

See merge request allianceauth/allianceauth!1268
2020-10-13 04:08:15 +00:00
Ariel Rin
fd86b26b39 Redirect to dashboard if not verifying email 2020-10-13 13:25:00 +10:00
Ariel Rin
b0dbef1587 Merge branch 'master' into 'master'
Expand mumble pwhash field to allow for passlib 1.7.3+

See merge request allianceauth/allianceauth!1267
2020-10-11 10:34:44 +00:00
Ariel Rin
a6e60bc23b expand mumble certhash to allow for hmac-sha-256 2020-10-11 20:11:56 +10:00
Ariel Rin
137e8a876d Merge branch 'add-corp-and-alliance-tags-to-srp' into 'master'
Add alliance and corp ticker to pilot name

See merge request allianceauth/allianceauth!1265
2020-10-11 03:42:56 +00:00
Ariel Rin
fe9538253f Merge branch 'highlight-active-menu-item' into 'master'
Highlight active menu item

See merge request allianceauth/allianceauth!1266
2020-10-11 03:41:17 +00:00
Peter Pfeufer
edda2c248e highlight active menu item 2020-10-02 20:12:21 +02:00
Peter Pfeufer
62275639e3 Added alliance and corp ticker to pilot name
Takes care of https://gitlab.com/allianceauth/allianceauth/-/issues/1228
2020-10-01 20:14:54 +02:00
Ariel Rin
d0c68b82f4 Merge branch 'docs' into 'master'
Docs Sphinx Upgrades

See merge request allianceauth/allianceauth!1264
2020-10-01 09:17:36 +00:00
Ariel Rin
78b5953bdf Merge branch 'master' of https://gitlab.com/allianceauth/allianceauth into docs 2020-10-01 18:59:14 +10:00
Ariel Rin
25e565b099 Docs Requirement upgrades 2020-10-01 18:54:04 +10:00
Ariel Rin
1fe0f78ad7 Exclude django-redis-cache 2.1.3 2020-10-01 01:59:48 +00:00
Ariel Rin
fc8b68156f Merge branch 'patch-4' into 'master'
Fixing FA icon

See merge request allianceauth/allianceauth!1262
2020-09-29 05:10:30 +00:00
Peter Pfeufer
b47cd197ce Fixing FA icon 2020-09-28 21:07:08 +00:00
Ariel Rin
3943426c4c Version Bump 2.8.0a2 2020-09-21 06:25:16 +00:00
Ariel Rin
08a9bd42a3 Merge branch 'django3' into 'master'
Django 3.1.1 bring up

See merge request allianceauth/allianceauth!1256
2020-09-21 06:16:44 +00:00
Ariel Rin
b2ff339efe Merge branch 'gitlabci2' into 'master'
Update Gitlab Deploy Python Version, Debian Distro to Stable

See merge request allianceauth/allianceauth!1260
2020-09-21 06:15:40 +00:00
Ariel Rin
c604131e04 Update Deploy Runner 2020-09-21 12:12:02 +10:00
Ariel Rin
f17607f126 Merge branch 'transifex' into 'master'
Update From Transifex

See merge request allianceauth/allianceauth!1258
2020-09-21 01:45:16 +00:00
Ariel Rin
94e455a57b Update From Transifex 2020-09-21 01:45:16 +00:00
Ariel Rin
3c9149db4a Merge branch 'improve_authtuilts_add_permission' into 'master'
Improve auth utils for permissions

See merge request allianceauth/allianceauth!1255
2020-09-21 01:09:03 +00:00
Ariel Rin
96cc615c07 Merge branch 'docs_mumbleavatars' into 'master'
Docs: Mumble Avatars Feature

See merge request allianceauth/allianceauth!1250
2020-09-21 00:01:35 +00:00
Ariel Rin
cd1f4a1c2b Docs: Mumble Avatars Feature 2020-09-21 00:01:35 +00:00
Ariel Rin
e0f99a42db Merge branch 'exiom-srp-update' into 'master'
SRP Module - Added Datatables & Sorting, Standardized Date/Time for Overall AA Consistency

See merge request allianceauth/allianceauth!1254
2020-09-20 23:55:22 +00:00
Exiom
3506e417d4 SRP Module - Added Datatables & Sorting, Standardized Date/Time for Overall AA Consistency 2020-09-20 23:55:22 +00:00
AaronKable
36197e2212 swap to reverse_lazy 2020-09-18 23:32:36 +08:00
AaronKable
fc5f42d01e remove whitespace in setup.py 2020-09-18 22:16:49 +08:00
AaronKable
e26d3767e0 update models as NullBooleanField is deprecated. 2020-09-18 22:16:24 +08:00
AaronKable
046b37c76a update auth and group model admins for django 3.1 2020-09-18 22:04:59 +08:00
AaronKable
925ff3e116 remove django req's from tox, they are managed in setup.py 2020-09-18 22:04:05 +08:00
AaronKable
e5ede4f7b6 Cant Reference what is already deleted 2020-09-18 22:03:16 +08:00
AaronKable
ded9301527 initial django3 bringup 2020-09-18 11:45:37 +08:00
ErikKalkoken
bd1ed6ff73 Add user as return value to add permission methods 2020-09-15 12:35:58 +02:00
Ariel Rin
feb65980d4 Merge branch 'fix_group_count_badge' into 'master'
Fix group count badge showing at zero

Closes #1258

See merge request allianceauth/allianceauth!1253
2020-09-12 02:05:22 +00:00
Ariel Rin
e81d75a782 Merge branch 'docs_settings_fix' into 'master'
Remove erroneous indents from settings in service module docs

See merge request allianceauth/allianceauth!1252
2020-09-12 02:04:37 +00:00
ErikKalkoken
ff305d13ae Fix group count badge showing at zero 2020-09-11 23:54:56 +02:00
colcrunch
8bcbc1a779 Remove erroneous indents from settings in service module docs. (Checked other docs, and there do not appear to be any more errors of this type) 2020-09-11 12:51:17 -04:00
Ariel Rin
3874aa6fee Version Bump 2.8.0a1 2020-09-11 11:52:20 +00:00
Ariel Rin
103e9f3a11 Merge branch 'discourse_beta' into 'master'
Discourse API with external package

See merge request allianceauth/allianceauth!1251
2020-09-11 11:33:19 +00:00
Ariel Rin
d02c25f421 Merge branch 'feature_menu_item_badges' into 'master'
Add menu item badge feature and update group icons

See merge request allianceauth/allianceauth!1240
2020-09-11 11:33:14 +00:00
Erik Kalkoken
228af38a4a Add menu item badge feature and update group icons 2020-09-11 11:33:14 +00:00
AaronKable
051a48885c discourse API with external package 2020-09-11 17:19:54 +08:00
Ariel Rin
6bcdc6052f Merge branch 'local-delivery' into 'master'
JS/CSS/Font Refactoring for use with AA-GDPR Package

Closes #1217

See merge request allianceauth/allianceauth!1247
2020-09-11 04:13:01 +00:00
Ariel Rin
af3527e64f Revert "load bootswatch less locally #1217"
This reverts commit 3a9a7267ea8734ba0a5cf1d0fea632eb2276d45c.
2020-09-11 04:13:01 +00:00
Ariel Rin
17ef3dd07a Merge branch 'srp_fix' into 'master'
Use request.scheme to get the http/https for the site

See merge request allianceauth/allianceauth!1249
2020-09-11 03:05:06 +00:00
AaronKable
1f165ecd2a use request.scheme to get the http/https for the site 2020-09-07 19:10:58 +08:00
Ariel Rin
70d1d450a9 Add Korean and Russian as features 2020-09-03 12:24:23 +00:00
Ariel Rin
b667892698 Version Bump 2.7.5 2020-09-01 02:09:05 +00:00
Ariel Rin
dc11add0e9 Merge branch 'discordapp.com-deprecation' into 'master'
discord.com replaces discordapp.com

See merge request allianceauth/allianceauth!1248
2020-09-01 01:53:25 +00:00
Ariel Rin
cb429a0b88 discord.com replaces discordapp.com 2020-09-01 11:20:57 +10:00
Ariel Rin
b51039cfc0 Merge branch 'docs' into 'master'
Add Optimizing Mumble to Services docs

See merge request allianceauth/allianceauth!1243
2020-09-01 01:11:49 +00:00
Ariel Rin
eadd959d95 Merge branch 'fix_celery_once_backend' into 'master'
Fix celery once not working properly

See merge request allianceauth/allianceauth!1246
2020-08-25 06:13:59 +00:00
Erik Kalkoken
1856e03d88 Fix celery once not working properly 2020-08-25 06:13:59 +00:00
Ariel Rin
7dcfa622a3 Merge branch 'issue_1234_exiom' into 'master'
Month Ordering Fix for Group Management Audit Logs

See merge request allianceauth/allianceauth!1245
2020-08-25 06:07:45 +00:00
Exiom
64251b9b3c Fix Date/Time Month Ordering #1234 2020-08-21 03:57:24 +00:00
Exiom
6b073dd5fc Fix Date/Time Month Ordering #1234 2020-08-21 03:33:35 +00:00
Ariel Rin
0911fabfb2 Merge branch 'issue_1234' into 'master'
Correct Month Ordering in Group Management Audit Logs

Closes #1234

See merge request allianceauth/allianceauth!1244
2020-08-20 07:11:47 +00:00
Ariel Rin
050d3f5e63 use month numerical 2020-08-20 16:55:18 +10:00
Ariel Rin
bbe3f78ad1 Grammar and Spelling Corrections 2020-08-20 15:19:50 +10:00
Ariel Rin
8204c18895 Add Optimzing Mumble 2020-08-20 15:09:07 +10:00
Ariel Rin
b91c788897 Merge branch 'bulk-affiliations' into 'master'
Reduce run time for eve online model updates

See merge request allianceauth/allianceauth!1227
2020-08-20 03:14:40 +00:00
Erik Kalkoken
1d20a3029f Only update characters if they have changed corp or alliance by bulk calling affiliations before calling character tasks. 2020-08-20 03:14:40 +00:00
Ariel Rin
9cfebc9ae3 Version Bump to 2.7.4 2020-08-17 06:34:55 +00:00
Ariel Rin
ddabb4539b Merge branch 'fix_admin_status_tags_bug' into 'master'
Bugfix: Loading of dashboard fails with 'NoneType object is not iterable' from status_tags

See merge request allianceauth/allianceauth!1237
2020-08-14 02:26:12 +00:00
Ariel Rin
ada35e221b Merge branch 'transifex' into 'master'
Update from Transifex

See merge request allianceauth/allianceauth!1241
2020-08-14 02:24:07 +00:00
Ariel Rin
6fef9d904e Update from Transifex 2020-08-14 02:24:07 +00:00
Ariel Rin
67cf2b5904 Merge branch 'fontawesomev5' into 'master'
Remove FA v4 shims, bump FA to 5.14

Closes #1248

See merge request allianceauth/allianceauth!1242
2020-08-14 02:21:41 +00:00
Ariel Rin
3bebe792f6 Remove FA v4 shims, bump to fa 5.14 2020-08-14 12:01:08 +10:00
ErikKalkoken
00b4d89181 Fix status tags bug and remove unused context from status_overview tag 2020-07-27 14:53:25 +02:00
Ariel Rin
f729c6b650 Merge branch 'patch-3' into 'master'
Update Mumble documentation on setting a server password

Closes #1252

See merge request allianceauth/allianceauth!1236
2020-07-24 11:18:02 +00:00
colcrunch
df95f8c3f3 Merge branch 'discord_improvements' into 'master'
Fix error 500 on service page for Discord and add feature "group_to_role"

See merge request allianceauth/allianceauth!1235
2020-07-23 20:58:26 +00:00
Erik Kalkoken
fe36e57d72 Fix error 500 on service page for Discord and add feature "group_to_role" 2020-07-23 20:58:26 +00:00
Peter Pfeufer
31197812b6 Update Mumble documentation on setting a server password (#1252) 2020-07-22 12:18:52 +00:00
Ariel Rin
bd3fe01a12 correct task import for manual model population 2020-07-14 12:25:05 +00:00
col_crunch
39f7f32b7d Version bump. 2020-07-13 15:32:54 -04:00
colcrunch
b4522a1277 Merge branch 'enable_django_esi_20' into 'master'
Enable django-esi 2.0 dependency

See merge request allianceauth/allianceauth!1232
2020-07-13 18:54:21 +00:00
colcrunch
bb6a7e8327 Merge branch 'issue_1250' into 'master'
Fix Discord service issues and improve dashboard

Closes #1250

See merge request allianceauth/allianceauth!1229
2020-07-13 18:54:08 +00:00
colcrunch
9bd42a7579 Merge branch 'docu_update_contributions' into 'master'
Add contributing chapter to docs

See merge request allianceauth/allianceauth!1233
2020-07-13 18:52:30 +00:00
Erik Kalkoken
b41430e5a3 Add contributing chapter to docs 2020-07-13 18:52:29 +00:00
ErikKalkoken
595353e838 Enable using django-esi 2.0 2020-07-11 12:35:16 +02:00
ErikKalkoken
f1a21bb856 Add state info to dashboard, improve stat change notifications, improve auth tests 2020-07-03 14:58:45 +02:00
ErikKalkoken
e44c2935f9 Version bump for alpha testing 2020-07-03 13:29:00 +02:00
ErikKalkoken
4d546f948d Fix state role not always updated due to lazy properties 2020-07-02 21:26:40 +02:00
ErikKalkoken
3bab349d7b Fix tests 2020-06-30 00:15:48 +02:00
ErikKalkoken
eef6126ef8 Improve state backend fix, add tests for state backend and service signal changes 2020-06-30 00:01:40 +02:00
ErikKalkoken
5c7478fa39 Fix update_nickname runs on ever save of userprofile, fix nickname not updated after main's name changes 2020-06-28 21:38:25 +02:00
ErikKalkoken
64b72d0b06 Fix service signals for state change 2020-06-28 17:14:16 +02:00
ErikKalkoken
b266a98b25 Add more tests for state change 2020-06-28 14:56:01 +02:00
ErikKalkoken
8a27de5df8 Fix state change does not update groups 2020-06-28 01:45:51 +02:00
ErikKalkoken
f9b5310fce Fix user account not deleted when demoted to guest 2020-06-27 23:32:12 +02:00
ErikKalkoken
fdce173969 Add tests to fix new bugs 2020-06-27 16:18:06 +02:00
ErikKalkoken
7b9ddf90c1 Fix tests for tox 2020-06-25 23:38:20 +02:00
ErikKalkoken
580c8c19de Update request timeout default 2020-06-25 22:32:29 +02:00
ErikKalkoken
55cc77140e Fix bug blocking superuser from adding Discord bot 2020-06-25 22:19:48 +02:00
Ariel Rin
93c89dd7cc Merge branch 'wother-master-patch-74872' into 'master'
Updated discord.md

See merge request allianceauth/allianceauth!1228
2020-06-22 03:19:27 +00:00
Carter Foulger
c970cbbd2d Updated discord.md with additional troubleshooting
steps.
2020-06-19 19:45:22 +00:00
Ariel Rin
9ea55fa51f Version Bump 2.7.2 2020-06-11 03:49:06 +00:00
Ariel Rin
5775a11b4e Merge branch 'replace_context_manager_groups' into 'master'
Improve page load performance by replacing groups context manager

See merge request allianceauth/allianceauth!1219
2020-06-11 03:41:31 +00:00
Ariel Rin
1a666b6584 Merge branch 'fontawesomev5' into 'master'
Font Awesome V5 Update

Closes #1207

See merge request allianceauth/allianceauth!1224
2020-06-11 03:33:37 +00:00
Ariel Rin
35407a2108 Font Awesome V5 Update 2020-06-11 03:33:37 +00:00
Ariel Rin
71fb19aa22 Merge branch 'version_battle' into 'master'
Make version relevant to an admin

See merge request allianceauth/allianceauth!1220
2020-06-11 03:13:13 +00:00
AaronKable
b7d7f7b8ce latest stable 2020-06-11 10:47:05 +08:00
Ariel Rin
59b983edcc Merge branch 'future' into 'master'
Remove Future dependency

Closes #1242

See merge request allianceauth/allianceauth!1223
2020-06-11 01:01:23 +00:00
Ariel Rin
1734d034e1 Merge branch 'evemodel_integers' into 'master'
Change EveModels to Integer ID fields

See merge request allianceauth/allianceauth!1211
2020-06-09 13:10:10 +00:00
Aaron Kable
7f7500ff0c Change EveModels to Integer ID fields 2020-06-09 13:10:10 +00:00
Ariel Rin
ce77c24e5c Exclude Celery 4.4.4 2020-06-09 11:30:13 +10:00
Ariel Rin
5469a591c0 Remove Future dependency 2020-06-09 11:10:32 +10:00
Ariel Rin
a4befc5e59 Version Bump 2.7.1 2020-06-09 00:25:30 +00:00
Ariel Rin
1ee8065592 Merge branch 'issue_1244' into 'master'
Fix sleep length must be non-negative

Closes #1244

See merge request allianceauth/allianceauth!1222
2020-06-09 00:23:36 +00:00
ErikKalkoken
e4e3bd44fc Fix sleep length must be non-negative 2020-06-08 14:59:22 +02:00
AaronKable
c75de07c2e Only show Pre-Release when available 2020-06-08 20:47:05 +08:00
AaronKable
e928131809 make version relevant to an admin 2020-06-08 19:18:11 +08:00
Ariel Rin
4f802e82a9 Version Bump to 2.7.0 2020-06-07 06:53:52 +00:00
Ariel Rin
0c90bd462e Merge branch 'remove_test_logging' into 'master'
Remove Test Logging from discourse

See merge request allianceauth/allianceauth!1207
2020-06-07 06:52:08 +00:00
ErikKalkoken
bbb70c93d9 Initial 2020-06-06 17:59:23 +02:00
Ariel Rin
f6e6ba775c Merge branch 'revert-3a984e8a' into 'master'
Revert "Merge branch 'notifications_refresh' into 'master'"

See merge request allianceauth/allianceauth!1216
2020-06-04 14:22:11 +00:00
Ariel Rin
06646be907 Merge branch 'fix_celery_4.4.4_issue' into 'master'
Add future to dependencies to fix celery 4.4.4 issue

See merge request allianceauth/allianceauth!1217
2020-06-04 11:58:28 +00:00
ErikKalkoken
1b4c1a4b9e Add future to dependencies 2020-06-04 13:52:34 +02:00
Ariel Rin
ae3f5a0f62 Revert "Merge branch 'notifications_refresh' into 'master'"
This reverts merge request !1215
2020-06-04 11:21:50 +00:00
Ariel Rin
3a984e8a4d Merge branch 'notifications_refresh' into 'master'
Add notifications auto refresh

See merge request allianceauth/allianceauth!1215
2020-06-04 08:25:01 +00:00
Erik Kalkoken
7d711a54bc Add notifications auto refresh 2020-06-04 08:25:01 +00:00
Ariel Rin
d92d629c25 Merge branch 'orm_fix' into 'master'
Fix Group Managment ORM Queries

See merge request allianceauth/allianceauth!1214
2020-05-27 02:23:37 +00:00
Ariel Rin
21e630209a Merge branch 'issue_1238' into 'master'
PEP440 versioning for admin dashboard

See merge request allianceauth/allianceauth!1213
2020-05-27 02:21:01 +00:00
Erik Kalkoken
e3933998ef PEP440 versioning for admin dashboard 2020-05-27 02:21:00 +00:00
Ariel Rin
667afe9051 Merge branch 'master' into 'master'
Update Extension Logger

Closes #1230

See merge request allianceauth/allianceauth!1206
2020-05-27 02:17:43 +00:00
AaronKable
26dc2881eb fix group managment ORM queries 2020-05-27 08:15:22 +08:00
Col Crunch
250cb33285 Raise an error if get_extension_logger recieves a non-string argument. 2020-05-26 13:49:06 -04:00
Col Crunch
db51abec1f Change default logging level for extension logger. 2020-05-26 13:26:19 -04:00
Col Crunch
530716d458 Fix docstring n get_extension_logger 2020-05-26 13:25:48 -04:00
Ariel Rin
f3065d79b3 Merge branch 'improve_evelinks' into 'master'
Add support for type icons to evelinks

See merge request allianceauth/allianceauth!1210
2020-05-25 14:51:42 +00:00
Erik Kalkoken
bca5f0472e Add support for type icons to evelinks 2020-05-25 14:51:41 +00:00
Ariel Rin
8e54c43917 Merge branch 'mumble-certhash' into 'master'
Add certhash field to Mumble user

See merge request allianceauth/allianceauth!1204
2020-05-25 14:46:03 +00:00
Ariel Rin
946df1d7a0 Merge branch 'issue_1234' into 'master'
Fix issue #1234 and add badges to group requests

Closes #1234

See merge request allianceauth/allianceauth!1212
2020-05-25 13:36:29 +00:00
ErikKalkoken
55f00f742c Fix issue #1234 and add badges to group requests 2020-05-25 15:22:08 +02:00
Ariel Rin
97b2cb71b7 Version Bump to 2.6.6a10 2020-05-25 12:55:05 +00:00
Ariel Rin
ba3a5ba53c Merge branch 'discord_delete_user_bug' into 'master'
Fix API exception handling for delete_user

See merge request allianceauth/allianceauth!1209
2020-05-25 01:28:25 +00:00
ErikKalkoken
953c09c999 Fix backoff exception handling for delete_user 2020-05-24 19:13:31 +02:00
Ariel Rin
b4cc325b07 Merge branch 'fix_test_order_issues' into 'master'
Make notification tests less order dependent

See merge request allianceauth/allianceauth!1208
2020-05-23 04:58:07 +00:00
AaronKable
28c1343f3e make tests less order dependant 2020-05-23 12:54:09 +08:00
Col Crunch
c16fd94c4a Update CI config for new version of gitlab. 2020-05-23 00:31:27 -04:00
Ariel Rin
bb2cc20838 Merge branch 'discord_ignore_managed_roles' into 'master'
Enable Discord service to deal with managed roles

See merge request allianceauth/allianceauth!1205
2020-05-23 04:28:01 +00:00
Erik Kalkoken
7b815fd010 Enable Discord service to deal with managed roles 2020-05-23 04:28:01 +00:00
AaronKable
18584974df remove test logging 2020-05-23 12:18:05 +08:00
Ariel Rin
15823b7785 Merge branch 'stop_context_spam' into 'master'
Stop the notification context provider from hitting the database for every menu hook

See merge request allianceauth/allianceauth!1201
2020-05-23 04:14:10 +00:00
Col Crunch
6c275d4cd2 Add comment to local describing how to change logger level. Also update docs to be consistent with this change. 2020-05-23 00:08:37 -04:00
Col Crunch
2d64ee5e2a Base extension logger level on the level of its parent. 2020-05-23 00:08:00 -04:00
AaronKable
3ae5ffa3f6 tests 2020-05-23 12:04:06 +08:00
Ben Cole
57d9ddc2c6 Add certhash field to Mumble user 2020-05-22 14:04:35 +01:00
Ariel Rin
8b84def494 Merge branch 'discord_update_usernames' into 'master'
Add update username feature

See merge request allianceauth/allianceauth!1203
2020-05-19 03:18:01 +00:00
ErikKalkoken
546f01ceb2 Add update username feature 2020-05-19 00:13:19 +02:00
Ariel Rin
be720d0e0f Merge branch 'redundant-sql' into 'master'
Use existing character variable on dashboard.

See merge request allianceauth/allianceauth!1202
2020-05-18 01:02:08 +00:00
Ariel Rin
72bed03244 Merge branch 'discord_service_overhaul' into 'master'
Discord service major overhaul

See merge request allianceauth/allianceauth!1200
2020-05-18 01:01:13 +00:00
Erik Kalkoken
38083ed284 Discord service major overhaul 2020-05-18 01:01:13 +00:00
Ariel Rin
53f1b94475 Correct typo in bzip2-devel dependency 2020-05-14 09:31:47 +00:00
AaronKable
ed4270a0e3 Use existing character variable. 2020-05-14 17:09:00 +08:00
Ariel Rin
f1d5cc8903 Merge branch 'discourse' into 'master'
API Headers for Discourse

See merge request allianceauth/allianceauth!1197
2020-05-12 00:00:43 +00:00
Ariel Rin
80efdec5d9 Version Bump 2.6.5 2020-05-10 03:17:39 +00:00
Ariel Rin
d49687400a Merge branch 'typo_fix' into 'master'
Typo Fix

See merge request allianceauth/allianceauth!1199
2020-05-10 03:13:35 +00:00
AaronKable
e6e03b50da Sorry Ariel. I promise to do better. 2020-05-08 23:48:18 +08:00
AaronKable
543fa3cfa9 extra logging for tests 2020-05-08 10:03:05 +08:00
Ariel Rin
899988c7c2 Merge branch 'i18n-chinese' into 'master'
Significant Korean Translation, Transifex Updates

See merge request allianceauth/allianceauth!1198
2020-05-08 01:12:37 +00:00
Ariel Rin
2f48dd449b Significant Korean Translation, Transifex Updates 2020-05-08 01:12:37 +00:00
AaronKable
f70fbbdfee headers for Discourse 2020-04-27 14:37:01 +08:00
Ariel Rin
2b09ca240d Merge branch 'fix_docu_py_upgrade' into 'master'
Docs only: Python upgrade guide and mumble installation guide

See merge request allianceauth/allianceauth!1193
2020-04-26 04:30:23 +00:00
Ariel Rin
0626ff84ad Merge branch 'group_add' into 'master'
Direct Group Link Copy Button

See merge request allianceauth/allianceauth!1196
2020-04-26 04:25:28 +00:00
Ariel Rin
62ec746ee3 Merge branch 'Jonnyw2k-master-patch-23183' into 'master'
Add OG metadata to base.html

Closes #1231

See merge request allianceauth/allianceauth!1195
2020-04-26 04:25:12 +00:00
ErikKalkoken
d0f12d7d56 Make customization its own chapter, add tuning section 2020-04-23 17:04:16 +02:00
ErikKalkoken
b806a69604 Improve mumble installation guide 2020-04-19 17:43:43 +02:00
AaronKable
a609d6360b add copy button to group manager screen 2020-04-18 10:43:01 +08:00
Jonnyw2k
dafbfc8644 Update allianceauth/authentication/templates/public/base.html 2020-04-18 02:12:12 +00:00
Jonnyw2k
55413eea19 Update allianceauth/authentication/templates/public/base.html 2020-04-18 01:22:07 +00:00
ErikKalkoken
5247c181af Fix django-celery-beat version in py upgrade guide 2020-04-18 01:14:27 +02:00
Ariel Rin
321af5ec87 Version Bump v2.6.4 2020-04-17 06:56:40 +00:00
Ariel Rin
9ccf340b3d Merge branch 'error-redirects' into 'master'
Add 500 and 400, 403, 404 error redirects back to dashboard with basic message

See merge request allianceauth/allianceauth!1152
2020-04-17 06:45:01 +00:00
Aaron Kable
d7dcacb899 Add 500 and 400, 403, 404 error redirects back to dashboard with basic message 2020-04-17 06:45:01 +00:00
Ariel Rin
8addd483c2 Merge branch 'issue_1221' into 'master'
Remove support for Python 3.5

Closes #1224 and #1221

See merge request allianceauth/allianceauth!1182
2020-04-15 11:25:44 +00:00
Ariel Rin
4d27e5ac9b Merge branch 'improve_help_icon' into 'master'
Improve style of help icon

See merge request allianceauth/allianceauth!1192
2020-04-15 11:24:55 +00:00
ErikKalkoken
31290f6e80 Improve style of help icon 2020-04-11 20:23:41 +02:00
Ariel Rin
c31cc4dbee Merge branch 'mumble_displaynames' into 'master'
Mumble Display Names

See merge request allianceauth/allianceauth!1185
2020-04-06 02:19:53 +00:00
Aaron Kable
cc1f94cf61 Mumble Display Names 2020-04-06 02:19:53 +00:00
Ariel Rin
a9132b8d50 Merge branch 'fix_dev_docs' into 'master'
Add config file for readthedocs

See merge request allianceauth/allianceauth!1191
2020-04-03 13:33:30 +00:00
ErikKalkoken
7b4a9891aa Add config file for readthedocs 2020-04-03 15:18:45 +02:00
Ariel Rin
dcaaf38ecc Merge branch 'esi_update' into 'master'
Update swagger files and remove swagger file dependency from srp package

See merge request allianceauth/allianceauth!1187
2020-04-03 12:39:34 +00:00
Ariel Rin
653a8aa850 Merge branch 'improve_docu_link' into 'master'
Move docu link to top menu and open in new window

See merge request allianceauth/allianceauth!1189
2020-04-03 12:04:06 +00:00
Ariel Rin
274af11385 Merge branch 'docu_devs_update' into 'master'
Extend developer docs

See merge request allianceauth/allianceauth!1188
2020-04-03 12:03:34 +00:00
Erik Kalkoken
170b246901 Extend developer docs 2020-04-03 12:03:34 +00:00
Ariel Rin
5250432ce3 Version Bump v2.6.3 2020-04-02 03:51:59 +00:00
Ariel Rin
53d6e973eb Merge branch 'i18n-chinese' into 'master'
Update Translations from Transifex

See merge request allianceauth/allianceauth!1190
2020-04-02 03:32:39 +00:00
Ariel Rin
c9bdd62d53 Update Translations from Transifex 2020-04-02 03:32:39 +00:00
Ariel Rin
7eb98af528 Merge branch 'issue_1225' into 'master'
Fix broken link and remove outdated migrations for services name formatter

Closes #1225

See merge request allianceauth/allianceauth!1183
2020-04-02 03:04:55 +00:00
Ariel Rin
385e3e21b3 Merge branch 'improve_groups_view' into 'master'
Add sorting to group view and add tests to group management

See merge request allianceauth/allianceauth!1172
2020-04-02 03:01:27 +00:00
Erik Kalkoken
127ec63d76 Add sorting to group view and add tests to group management 2020-04-02 03:01:27 +00:00
Ariel Rin
4988b5f260 Merge branch 'common_logger' into 'master'
Extensions Logging

See merge request allianceauth/allianceauth!1180
2020-04-02 02:59:55 +00:00
Ariel Rin
f28a50f92c Merge branch 'fix_translations_3' into 'master'
Add missing translations

See merge request allianceauth/allianceauth!1186
2020-03-26 03:06:11 +00:00
Ariel Rin
e8efe8e609 Merge branch 'i18n-chinese' into 'master'
Add Korean and Russian, Update from Transifex

See merge request allianceauth/allianceauth!1179
2020-03-26 02:50:25 +00:00
Ariel Rin
d7e7457bc5 Add Korean and Russian, Update from Transifex 2020-03-26 02:50:25 +00:00
Ariel Rin
daff927811 Merge branch 'prioritize_celery' into 'master'
Add Celery Priorities

See merge request allianceauth/allianceauth!1181
2020-03-26 02:20:02 +00:00
Aaron Kable
8861ec0a61 Add Celery Priorities 2020-03-26 02:20:02 +00:00
Ariel Rin
bd4321f61a Merge branch 'docs_update' into 'master'
Docs only: Harmonize gunicorn config, add localization feature

See merge request allianceauth/allianceauth!1184
2020-03-26 01:55:03 +00:00
Erik Kalkoken
d831482fe0 Docs only: Harmonize gunicorn config, add localization feature 2020-03-26 01:55:03 +00:00
ErikKalkoken
9ea79ea389 Move docu link to top menu and open in new window 2020-03-26 00:10:30 +01:00
ErikKalkoken
b6fdf840ef Update swagger files and remove swagger fle dependency from srp package 2020-03-25 18:00:23 +01:00
ErikKalkoken
73f262ce4b Add missing translations 2020-03-24 20:21:35 +01:00
ErikKalkoken
f63434adc3 Fix broken link and remove outdated migrations for services name formatter 2020-03-21 14:41:45 +01:00
ErikKalkoken
42948386ec Remove support for Python 3.5 2020-03-21 13:16:42 +01:00
Aaron Kable
1ce0dbde0e stop the notification context profider from hitting the database for each menu hook 2020-03-16 02:09:24 +00:00
Ariel Rin
32e0621b0a Merge branch 'improve_install_docu' into 'master'
Docs: Add python upgrade guide, remove old AA 1.15 upgrade guide, improve install guide

See merge request allianceauth/allianceauth!1177
2020-03-15 12:21:21 +00:00
Erik Kalkoken
78e05b84e9 Docs: Add python upgrade guide, remove old AA 1.15 upgrade guide, improve install guide 2020-03-15 12:21:21 +00:00
Col Crunch
76ebd21163 Add function to services.hooks to provide a concise way for creating loggers for extensions/plugins. Revise basic documentation to use this function. 2020-03-13 15:21:15 -04:00
Col Crunch
38aaf545c6 Add some very basic docs for logging changes 2020-03-13 14:42:09 -04:00
Col Crunch
527d7ef671 Change level of extension_file handler, rename the logger from allianceauth.extensions to extensions and remove propagate from the logger. 2020-03-13 04:42:09 -04:00
Col Crunch
e54b80e061 Add a common logger (and specific log file) for extensions to utilize. 2020-03-13 00:33:35 -04:00
Col Crunch
27f95a8b2c Remove Zone.Indentifier files. 2020-03-12 23:55:34 -04:00
290 changed files with 23788 additions and 3727 deletions

5
.gitignore vendored
View File

@@ -72,3 +72,8 @@ celerybeat-schedule
#transifex
.tx/
#other
.flake8
.pylintrc
Makefile

View File

@@ -1,16 +1,14 @@
stages:
- "test"
- test
- deploy
before_script:
- apt-get update && apt-get install redis-server -y
- redis-server --daemonize yes
- redis-cli ping
- python -V
- pip install wheel tox
test-3.5-core:
image: python:3.5-buster
script:
- tox -e py35-core
test-3.6-core:
image: python:3.6-buster
script:
@@ -26,11 +24,6 @@ test-3.8-core:
script:
- tox -e py38-core
test-3.5-all:
image: python:3.5-buster
script:
- tox -e py35-all
test-3.6-all:
image: python:3.6-buster
script:
@@ -48,7 +41,7 @@ test-3.8-all:
deploy_production:
stage: deploy
image: python:3.6-stretch
image: python:3.8-buster
before_script:
- pip install twine
@@ -57,5 +50,5 @@ deploy_production:
- python setup.py sdist
- twine upload dist/*
only:
- tags
rules:
- if: $CI_COMMIT_TAG

27
.readthedocs.yml Normal file
View File

@@ -0,0 +1,27 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- testing
system_packages: true

View File

@@ -11,32 +11,34 @@
An auth system for EVE Online to help in-game organizations manage online service access.
## Contens
## Content
- [Overview](#overview)
- [Documentation](http://allianceauth.rtfd.io)
- [Support](#support)
- [Release Notes](https://gitlab.com/allianceauth/allianceauth/-/releases)
- [Devloper Team](#developer-team)
- [Developer Team](#developer-team)
- [Contributing](#contributing)
## Overview
Alliance Auth (AA) is a web application that helps Eve Online organizations efficiently manage access to their applications and services.
Alliance Auth (AA) is a web site that helps Eve Online organizations efficiently manage access to applications and services.
Main features:
- Automatically grants or revokes user access to external applications / services (e.g. Discord, Mumble) and web apps (e.g. SRP requests) based on the user's current membership to [in-game organizations](https://allianceauth.readthedocs.io/en/latest/features/states/) and [groups](https://allianceauth.readthedocs.io/en/latest/features/groups/)
- Automatically grants or revokes user access to external services (e.g. Discord, Mumble) and web apps (e.g. SRP requests) based on the user's current membership to [in-game organizations](https://allianceauth.readthedocs.io/en/latest/features/core/states/) and [groups](https://allianceauth.readthedocs.io/en/latest/features/core/groups/)
- Provides a central web site where users can directly access web apps (e.g. SRP requests, Fleet Schedule) and manage their access to external services and groups.
- Includes a set of connectors (called ["services"](https://allianceauth.readthedocs.io/en/latest/installation/services/)) for integrating access management with many popular external applications / services like Discord, Mumble, Teamspeak 3, SMF and others
- Includes a set of connectors (called ["services"](https://allianceauth.readthedocs.io/en/latest/features/services/)) for integrating access management with many popular external applications / services like Discord, Mumble, Teamspeak 3, SMF and others
- Includes a set of web apps called ["plug-in apps"](https://allianceauth.readthedocs.io/en/latest/features/) which add many useful functions: fleet schedule, timer board, SRP request management, fleet activity tracker and character application management
- Includes a set of web [apps](https://allianceauth.readthedocs.io/en/latest/features/apps/) which add many useful functions, e.g.: fleet schedule, timer board, SRP request management, fleet activity tracker
- Can be easily extended with new services and plugin-apps. Many additional services and plugin-apps are provided by the community and can be found here: [Community Creations](https://gitlab.com/allianceauth/community-creations)
- Can be easily extended with additional services and apps. Many are provided by the community and can be found here: [Community Creations](https://gitlab.com/allianceauth/community-creations)
For further details about AA - including an installation guide and a full list of included services and plugin apps - please see the [offical documentation](http://allianceauth.rtfd.io).
- English :flag_gb:, Chinese :flag_cn:, German :flag_de:, Spanish :flag_es:, Korean :flag_kr: and Russian :flag_ru: localization
For further details about AA - including an installation guide and a full list of included services and plugin apps - please see the [official documentation](http://allianceauth.rtfd.io).
## Screenshot

View File

@@ -1,6 +1,8 @@
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
__version__ = '2.6.2'
NAME = 'Alliance Auth v%s' % __version__
__version__ = '2.8.0'
__title__ = 'Alliance Auth'
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
NAME = '%s v%s' % (__title__, __version__)
default_app_config = 'allianceauth.apps.AllianceAuthConfig'

View File

@@ -37,8 +37,11 @@ def make_service_hooks_update_groups_action(service):
:return: fn to update services groups for the selected users
"""
def update_service_groups(modeladmin, request, queryset):
for user in queryset: # queryset filtering doesn't work here?
service.update_groups(user)
if hasattr(service, 'update_groups_bulk'):
service.update_groups_bulk(queryset)
else:
for user in queryset: # queryset filtering doesn't work here?
service.update_groups(user)
update_service_groups.__name__ = str('update_{}_groups'.format(slugify(service.name)))
update_service_groups.short_description = "Sync groups for selected {} accounts".format(service.title)
@@ -52,8 +55,11 @@ def make_service_hooks_sync_nickname_action(service):
:return: fn to sync nickname for the selected users
"""
def sync_nickname(modeladmin, request, queryset):
for user in queryset: # queryset filtering doesn't work here?
service.sync_nickname(user)
if hasattr(service, 'sync_nicknames_bulk'):
service.sync_nicknames_bulk(queryset)
else:
for user in queryset: # queryset filtering doesn't work here?
service.sync_nickname(user)
sync_nickname.__name__ = str('sync_{}_nickname'.format(slugify(service.name)))
sync_nickname.short_description = "Sync nicknames for selected {} accounts".format(service.title)
@@ -94,7 +100,7 @@ class UserProfileInline(admin.StackedInline):
formset.get_form_kwargs = get_kwargs
return formset
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
@@ -506,7 +512,7 @@ class BaseOwnershipAdmin(admin.ModelAdmin):
'character',
)
search_fields = (
'user__user',
'user__username',
'character__character_name',
'character__corporation_name',
'character__alliance_name'
@@ -543,7 +549,7 @@ class PermissionAdmin(admin.ModelAdmin):
def admin_name(obj):
return str(obj)
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):

View File

@@ -1,7 +1,8 @@
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import Permission
from django.contrib.auth.models import User
import logging
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User, Permission
from .models import UserProfile, CharacterOwnership, OwnershipRecord
@@ -11,9 +12,11 @@ logger = logging.getLogger(__name__)
class StateBackend(ModelBackend):
@staticmethod
def _get_state_permissions(user_obj):
profile_state_field = UserProfile._meta.get_field('state')
user_state_query = 'state__%s__user' % profile_state_field.related_query_name()
return Permission.objects.filter(**{user_state_query: user_obj})
"""returns permissions for state of given user object"""
if hasattr(user_obj, "profile") and user_obj.profile:
return Permission.objects.filter(state=user_obj.profile.state)
else:
return Permission.objects.none()
def get_state_permissions(self, user_obj, obj=None):
return self._get_permissions(user_obj, obj, 'state')

View File

@@ -1,6 +1,8 @@
from django import forms
from django.utils.translation import ugettext_lazy as _
from allianceauth.authentication.models import User
class RegistrationForm(forms.Form):
email = forms.EmailField(label=_('Email'), max_length=254, required=True)
class _meta:
model = User

View File

@@ -10,5 +10,5 @@ urlpatterns = [
url(r'^register/$', views.RegistrationView.as_view(), name='registration_register'),
url(r'^register/complete/$', views.registration_complete, name='registration_complete'),
url(r'^register/closed/$', views.registration_closed, name='registration_disallowed'),
url(r'', include('registration.auth_urls')),
url(r'', include('django.contrib.auth.urls')),
]

View File

@@ -73,11 +73,17 @@ class UserProfile(models.Model):
if commit:
logger.info('Updating {} state to {}'.format(self.user, self.state))
self.save(update_fields=['state'])
notify(self.user, _('State Changed'),
_('Your user state has been changed to %(state)s') % ({'state': state}),
'info')
notify(
self.user,
_('State changed to: %s' % state),
_('Your user\'s state is now: %(state)s')
% ({'state': state}),
'info'
)
from allianceauth.authentication.signals import state_changed
state_changed.send(sender=self.__class__, user=self.user, state=self.state)
state_changed.send(
sender=self.__class__, user=self.user, state=self.state
)
def __str__(self):
return str(self.user)

View File

@@ -23,9 +23,7 @@ def trigger_state_check(state):
check_states = State.objects.filter(priority__lt=state.priority)
for profile in UserProfile.objects.filter(state__in=check_states):
if state.available_to_user(profile.user):
profile.state = state
profile.save(update_fields=['state'])
state_changed.send(sender=state.__class__, user=profile.user, state=state)
profile.assign_state(state)
@receiver(m2m_changed, sender=State.member_characters.through)

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Dashboard" %}{% endblock %}
@@ -14,7 +14,11 @@
<div class="col-sm-6 text-center">
<div class="panel panel-primary" style="height:100%">
<div class="panel-heading">
<h3 class="panel-title">{% trans "Main Character" %}</h3>
<h3 class="panel-title">
{% blocktrans with state=request.user.profile.state %}
Main Character (State: {{ state }})
{% endblocktrans %}
</h3>
</div>
<div class="panel-body">
{% if request.user.profile.main_character %}
@@ -141,19 +145,17 @@
</table>
<table class="table table-aa visible-xs-block" style="width: 100%">
<tbody>
{% for ownership in request.user.character_ownerships.all %}
{% with ownership.character as char %}
<tr>
<td class="text-center" style="vertical-align: middle">
<img class="ra-avatar img-circle" src="{{ char.portrait_url_32 }}">
</td>
<td class="text-center" style="vertical-align: middle; width: 100%">
<strong>{{ char.character_name }}</strong><br>
{{ char.corporation_name }}<br>
{{ char.alliance_name|default:"" }}
</td>
</tr>
{% endwith %}
{% for char in characters %}
<tr>
<td class="text-center" style="vertical-align: middle">
<img class="ra-avatar img-circle" src="{{ char.portrait_url_32 }}">
</td>
<td class="text-center" style="vertical-align: middle; width: 100%">
<strong>{{ char.character_name }}</strong><br>
{{ char.corporation_name }}<br>
{{ char.alliance_name|default:"" }}
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -6,6 +6,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta property="og:title" content="{{ SITE_NAME }}">
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{% static 'icons/apple-touch-icon.png' %}">
<meta property="og:description" content="Alliance Auth - An auth system for EVE Online to help in-game organizations manage online service access.">
{% include 'allianceauth/icons.html' %}
<title>{% block title %}{{ SITE_NAME }}{% endblock %}</title>

View File

@@ -1,7 +1,7 @@
{% load staticfiles %}
{% extends 'public/base.html' %}
{% load static %}
{% load bootstrap %}
{% load i18n %}
{% extends 'public/base.html' %}
{% block page_title %}Registration{% endblock %}
{% block extra_include %}
{% include 'bundles/bootstrap-css.html' %}

View File

@@ -2,10 +2,17 @@ from django.urls import reverse
def get_admin_change_view_url(obj: object) -> str:
"""returns URL to admin change view for given object"""
return reverse(
'admin:{}_{}_change'.format(
obj._meta.app_label,
type(obj).__name__.lower()
obj._meta.app_label, type(obj).__name__.lower()
),
args=(obj.pk,)
)
def get_admin_search_url(ModelClass: type) -> str:
"""returns URL to search URL for model of given object"""
return '{}{}/'.format(
reverse('admin:app_list', args=(ModelClass._meta.app_label,)),
ModelClass.__name__.lower()
)

View File

@@ -1,4 +1,5 @@
from unittest.mock import patch
from urllib.parse import quote
from unittest.mock import patch, MagicMock
from django.conf import settings
from django.contrib import admin
@@ -6,11 +7,13 @@ from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User as BaseUser, Group
from django.test import TestCase, RequestFactory, Client
from allianceauth.authentication.models import CharacterOwnership, State, \
OwnershipRecord
from allianceauth.authentication.models import (
CharacterOwnership, State, OwnershipRecord
)
from allianceauth.eveonline.models import (
EveCharacter, EveCorporationInfo, EveAllianceInfo
)
from allianceauth.services.hooks import ServicesHook
from allianceauth.tests.auth_utils import AuthUtils
from ..admin import (
@@ -26,9 +29,11 @@ from ..admin import (
user_main_organization,
user_profile_pic,
user_username,
update_main_character_model
update_main_character_model,
make_service_hooks_update_groups_action,
make_service_hooks_sync_nickname_action
)
from . import get_admin_change_view_url
from . import get_admin_change_view_url, get_admin_search_url
if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS:
_has_auto_groups = True
@@ -43,144 +48,158 @@ class MockRequest(object):
def __init__(self, user=None):
self.user = user
class TestCaseWithTestData(TestCase):
def create_test_data():
# groups
group_1 = Group.objects.create(
name='Group 1'
)
group_2 = Group.objects.create(
name='Group 2'
)
# user 1 - corp and alliance, normal user
character_1 = EveCharacter.objects.create(
character_id='1001',
character_name='Bruce Wayne',
corporation_id='2001',
corporation_name='Wayne Technologies',
corporation_ticker='WT',
alliance_id='3001',
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
)
character_1a = EveCharacter.objects.create(
character_id='1002',
character_name='Batman',
corporation_id='2001',
corporation_name='Wayne Technologies',
corporation_ticker='WT',
alliance_id='3001',
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
)
alliance = EveAllianceInfo.objects.create(
alliance_id='3001',
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
executor_corp_id='2001'
)
EveCorporationInfo.objects.create(
corporation_id='2001',
corporation_name='Wayne Technologies',
corporation_ticker='WT',
member_count=42,
alliance=alliance
)
user_1 = User.objects.create_user(
character_1.character_name.replace(' ', '_'),
'abc@example.com',
'password'
)
CharacterOwnership.objects.create(
character=character_1,
owner_hash='x1' + character_1.character_name,
user=user_1
)
CharacterOwnership.objects.create(
character=character_1a,
owner_hash='x1' + character_1a.character_name,
user=user_1
)
user_1.profile.main_character = character_1
user_1.profile.save()
user_1.groups.add(group_1)
# user 2 - corp only, staff
character_2 = EveCharacter.objects.create(
character_id=1003,
character_name='Clark Kent',
corporation_id=2002,
corporation_name='Daily Planet',
corporation_ticker='DP',
alliance_id=None
)
EveCorporationInfo.objects.create(
corporation_id=2002,
corporation_name='Daily Plane',
corporation_ticker='DP',
member_count=99,
alliance=None
)
user_2 = User.objects.create_user(
character_2.character_name.replace(' ', '_'),
'abc@example.com',
'password'
)
CharacterOwnership.objects.create(
character=character_2,
owner_hash='x1' + character_2.character_name,
user=user_2
)
user_2.profile.main_character = character_2
user_2.profile.save()
user_2.groups.add(group_2)
user_2.is_staff = True
user_2.save()
# user 3 - no main, no group, superuser
character_3 = EveCharacter.objects.create(
character_id=1101,
character_name='Lex Luthor',
corporation_id=2101,
corporation_name='Lex Corp',
corporation_ticker='LC',
alliance_id=None
)
EveCorporationInfo.objects.create(
corporation_id=2101,
corporation_name='Lex Corp',
corporation_ticker='LC',
member_count=666,
alliance=None
)
EveAllianceInfo.objects.create(
alliance_id='3101',
alliance_name='Lex World Domination',
alliance_ticker='LWD',
executor_corp_id=''
)
user_3 = User.objects.create_user(
character_3.character_name.replace(' ', '_'),
'abc@example.com',
'password'
)
CharacterOwnership.objects.create(
character=character_3,
owner_hash='x1' + character_3.character_name,
user=user_3
)
user_3.is_superuser = True
user_3.save()
return user_1, user_2, user_3, group_1, group_2
class TestCharacterOwnershipAdmin(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user_1, _, _, _, _ = create_test_data()
super().setUpClass()
for MyModel in [
EveAllianceInfo, EveCorporationInfo, EveCharacter, Group, User
]:
MyModel.objects.all().delete()
# groups
cls.group_1 = Group.objects.create(
name='Group 1'
)
cls.group_2 = Group.objects.create(
name='Group 2'
)
# user 1 - corp and alliance, normal user
character_1 = EveCharacter.objects.create(
character_id=1001,
character_name='Bruce Wayne',
corporation_id=2001,
corporation_name='Wayne Technologies',
corporation_ticker='WT',
alliance_id=3001,
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
)
character_1a = EveCharacter.objects.create(
character_id=1002,
character_name='Batman',
corporation_id=2001,
corporation_name='Wayne Technologies',
corporation_ticker='WT',
alliance_id=3001,
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
)
alliance = EveAllianceInfo.objects.create(
alliance_id=3001,
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
executor_corp_id=2001
)
EveCorporationInfo.objects.create(
corporation_id=2001,
corporation_name='Wayne Technologies',
corporation_ticker='WT',
member_count=42,
alliance=alliance
)
cls.user_1 = User.objects.create_user(
character_1.character_name.replace(' ', '_'),
'abc@example.com',
'password'
)
CharacterOwnership.objects.create(
character=character_1,
owner_hash='x1' + character_1.character_name,
user=cls.user_1
)
CharacterOwnership.objects.create(
character=character_1a,
owner_hash='x1' + character_1a.character_name,
user=cls.user_1
)
cls.user_1.profile.main_character = character_1
cls.user_1.profile.save()
cls.user_1.groups.add(cls.group_1)
# user 2 - corp only, staff
character_2 = EveCharacter.objects.create(
character_id=1003,
character_name='Clark Kent',
corporation_id=2002,
corporation_name='Daily Planet',
corporation_ticker='DP',
alliance_id=None
)
EveCorporationInfo.objects.create(
corporation_id=2002,
corporation_name='Daily Plane',
corporation_ticker='DP',
member_count=99,
alliance=None
)
cls.user_2 = User.objects.create_user(
character_2.character_name.replace(' ', '_'),
'abc@example.com',
'password'
)
CharacterOwnership.objects.create(
character=character_2,
owner_hash='x1' + character_2.character_name,
user=cls.user_2
)
cls.user_2.profile.main_character = character_2
cls.user_2.profile.save()
cls.user_2.groups.add(cls.group_2)
cls.user_2.is_staff = True
cls.user_2.save()
# user 3 - no main, no group, superuser
character_3 = EveCharacter.objects.create(
character_id=1101,
character_name='Lex Luthor',
corporation_id=2101,
corporation_name='Lex Corp',
corporation_ticker='LC',
alliance_id=None
)
EveCorporationInfo.objects.create(
corporation_id=2101,
corporation_name='Lex Corp',
corporation_ticker='LC',
member_count=666,
alliance=None
)
EveAllianceInfo.objects.create(
alliance_id=3101,
alliance_name='Lex World Domination',
alliance_ticker='LWD',
executor_corp_id=2101
)
cls.user_3 = User.objects.create_user(
character_3.character_name.replace(' ', '_'),
'abc@example.com',
'password'
)
CharacterOwnership.objects.create(
character=character_3,
owner_hash='x1' + character_3.character_name,
user=cls.user_3
)
cls.user_3.is_superuser = True
cls.user_3.save()
def make_generic_search_request(ModelClass: type, search_term: str):
User.objects.create_superuser(
username='superuser', password='secret', email='admin@example.com'
)
c = Client()
c.login(username='superuser', password='secret')
return c.get(
'%s?q=%s' % (get_admin_search_url(ModelClass), quote(search_term))
)
class TestCharacterOwnershipAdmin(TestCaseWithTestData):
def setUp(self):
self.modeladmin = CharacterOwnershipAdmin(
@@ -197,13 +216,16 @@ class TestCharacterOwnershipAdmin(TestCase):
response = c.get(get_admin_change_view_url(ownership))
self.assertEqual(response.status_code, 200)
def test_search_works(self):
obj = CharacterOwnership.objects\
.filter(user=self.user_1)\
.first()
response = make_generic_search_request(type(obj), obj.user.username)
expected = 200
self.assertEqual(response.status_code, expected)
class TestOwnershipRecordAdmin(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user_1, _, _, _, _ = create_test_data()
class TestOwnershipRecordAdmin(TestCaseWithTestData):
def setUp(self):
self.modeladmin = OwnershipRecordAdmin(
@@ -222,14 +244,15 @@ class TestOwnershipRecordAdmin(TestCase):
response = c.get(get_admin_change_view_url(ownership_record))
self.assertEqual(response.status_code, 200)
def test_search_works(self):
obj = OwnershipRecord.objects.first()
response = make_generic_search_request(type(obj), obj.user.username)
expected = 200
self.assertEqual(response.status_code, expected)
class TestStateAdmin(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
create_test_data()
class TestStateAdmin(TestCaseWithTestData):
def setUp(self):
self.modeladmin = StateAdmin(
model=User, admin_site=AdminSite()
@@ -250,14 +273,13 @@ class TestStateAdmin(TestCase):
response = c.get(get_admin_change_view_url(member_state))
self.assertEqual(response.status_code, 200)
def test_search_works(self):
obj = State.objects.first()
response = make_generic_search_request(type(obj), obj.name)
expected = 200
self.assertEqual(response.status_code, expected)
class TestUserAdmin(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user_1, cls.user_2, cls.user_3, cls.group_1, cls.group_2 = \
create_test_data()
class TestUserAdmin(TestCaseWithTestData):
def setUp(self):
self.factory = RequestFactory()
@@ -488,8 +510,8 @@ class TestUserAdmin(TestCase):
filters = changelist.get_filters(request)
filterspec = filters[0][0]
expected = [
('2002', 'Daily Planet'),
('2001', 'Wayne Technologies'),
(2002, 'Daily Planet'),
(2001, 'Wayne Technologies'),
]
self.assertEqual(filterspec.lookup_choices, expected)
@@ -518,7 +540,7 @@ class TestUserAdmin(TestCase):
filters = changelist.get_filters(request)
filterspec = filters[0][0]
expected = [
('3001', 'Wayne Enterprises'),
(3001, 'Wayne Enterprises'),
]
self.assertEqual(filterspec.lookup_choices, expected)
@@ -541,3 +563,73 @@ class TestUserAdmin(TestCase):
c.login(username='superuser', password='secret')
response = c.get(get_admin_change_view_url(self.user_1))
self.assertEqual(response.status_code, 200)
def test_search_works(self):
obj = User.objects.first()
response = make_generic_search_request(type(obj), obj.username)
expected = 200
self.assertEqual(response.status_code, expected)
class TestMakeServicesHooksActions(TestCaseWithTestData):
class MyServicesHookTypeA(ServicesHook):
def __init__(self):
super().__init__()
self.name = 'My Service A'
def update_groups(self, user):
pass
def sync_nicknames(self, user):
pass
class MyServicesHookTypeB(ServicesHook):
def __init__(self):
super().__init__()
self.name = 'My Service B'
def update_groups(self, user):
pass
def update_groups_bulk(self, user):
pass
def sync_nicknames(self, user):
pass
def sync_nicknames_bulk(self, user):
pass
def test_service_has_update_groups_only(self):
service = self.MyServicesHookTypeA()
mock_service = MagicMock(spec=service)
action = make_service_hooks_update_groups_action(mock_service)
action(MagicMock(), MagicMock(), [self.user_1])
self.assertTrue(mock_service.update_groups.called)
def test_service_has_update_groups_bulk(self):
service = self.MyServicesHookTypeB()
mock_service = MagicMock(spec=service)
action = make_service_hooks_update_groups_action(mock_service)
action(MagicMock(), MagicMock(), [self.user_1])
self.assertFalse(mock_service.update_groups.called)
self.assertTrue(mock_service.update_groups_bulk.called)
def test_service_has_sync_nickname_only(self):
service = self.MyServicesHookTypeA()
mock_service = MagicMock(spec=service)
action = make_service_hooks_sync_nickname_action(mock_service)
action(MagicMock(), MagicMock(), [self.user_1])
self.assertTrue(mock_service.sync_nickname.called)
def test_service_has_sync_nicknames_bulk(self):
service = self.MyServicesHookTypeB()
mock_service = MagicMock(spec=service)
action = make_service_hooks_sync_nickname_action(mock_service)
action(MagicMock(), MagicMock(), [self.user_1])
self.assertFalse(mock_service.sync_nickname.called)
self.assertTrue(mock_service.sync_nicknames_bulk.called)

View File

@@ -0,0 +1,149 @@
from django.contrib.auth.models import User, Group
from django.test import TestCase
from allianceauth.eveonline.models import EveCharacter
from allianceauth.tests.auth_utils import AuthUtils
from esi.models import Token
from ..backends import StateBackend
from ..models import CharacterOwnership, UserProfile, OwnershipRecord
MODULE_PATH = 'allianceauth.authentication'
PERMISSION_1 = "authentication.add_user"
PERMISSION_2 = "authentication.change_user"
class TestStatePermissions(TestCase):
def setUp(self):
# permissions
self.permission_1 = AuthUtils.get_permission_by_name(PERMISSION_1)
self.permission_2 = AuthUtils.get_permission_by_name(PERMISSION_2)
# group
self.group_1 = Group.objects.create(name="Group 1")
self.group_2 = Group.objects.create(name="Group 2")
# state
self.state_1 = AuthUtils.get_member_state()
self.state_2 = AuthUtils.create_state("Other State", 75)
# user
self.user = AuthUtils.create_user("Bruce Wayne")
self.main = AuthUtils.add_main_character_2(self.user, self.user.username, 123)
def test_user_has_user_permissions(self):
self.user.user_permissions.add(self.permission_1)
user = User.objects.get(pk=self.user.pk)
self.assertTrue(user.has_perm(PERMISSION_1))
def test_user_has_group_permissions(self):
self.group_1.permissions.add(self.permission_1)
self.user.groups.add(self.group_1)
user = User.objects.get(pk=self.user.pk)
self.assertTrue(user.has_perm(PERMISSION_1))
def test_user_has_state_permissions(self):
self.state_1.permissions.add(self.permission_1)
self.state_1.member_characters.add(self.main)
user = User.objects.get(pk=self.user.pk)
self.assertTrue(user.has_perm(PERMISSION_1))
def test_when_user_changes_state_perms_change_accordingly(self):
self.state_1.permissions.add(self.permission_1)
self.state_1.member_characters.add(self.main)
user = User.objects.get(pk=self.user.pk)
self.assertTrue(user.has_perm(PERMISSION_1))
self.state_2.permissions.add(self.permission_2)
self.state_2.member_characters.add(self.main)
self.state_1.member_characters.remove(self.main)
user = User.objects.get(pk=self.user.pk)
self.assertFalse(user.has_perm(PERMISSION_1))
self.assertTrue(user.has_perm(PERMISSION_2))
def test_state_permissions_are_returned_for_current_user_object(self):
# verify state permissions are returns for the current user object
# and not for it's instance in the database, which might be outdated
self.state_1.permissions.add(self.permission_1)
self.state_2.permissions.add(self.permission_2)
self.state_1.member_characters.add(self.main)
user = User.objects.get(pk=self.user.pk)
user.profile.state = self.state_2
self.assertFalse(user.has_perm(PERMISSION_1))
self.assertTrue(user.has_perm(PERMISSION_2))
class TestAuthenticate(TestCase):
@classmethod
def setUpTestData(cls):
cls.main_character = EveCharacter.objects.create(
character_id=1,
character_name='Main Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
cls.alt_character = EveCharacter.objects.create(
character_id=2,
character_name='Alt Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
cls.unclaimed_character = EveCharacter.objects.create(
character_id=3,
character_name='Unclaimed Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
cls.user = AuthUtils.create_user('test_user', disconnect_signals=True)
cls.old_user = AuthUtils.create_user('old_user', disconnect_signals=True)
AuthUtils.disconnect_signals()
CharacterOwnership.objects.create(user=cls.user, character=cls.main_character, owner_hash='1')
CharacterOwnership.objects.create(user=cls.user, character=cls.alt_character, owner_hash='2')
UserProfile.objects.update_or_create(user=cls.user, defaults={'main_character': cls.main_character})
AuthUtils.connect_signals()
def test_authenticate_main_character(self):
t = Token(character_id=self.main_character.character_id, character_owner_hash='1')
user = StateBackend().authenticate(token=t)
self.assertEquals(user, self.user)
def test_authenticate_alt_character(self):
t = Token(character_id=self.alt_character.character_id, character_owner_hash='2')
user = StateBackend().authenticate(token=t)
self.assertEquals(user, self.user)
def test_authenticate_unclaimed_character(self):
t = Token(character_id=self.unclaimed_character.character_id, character_name=self.unclaimed_character.character_name, character_owner_hash='3')
user = StateBackend().authenticate(token=t)
self.assertNotEqual(user, self.user)
self.assertEqual(user.username, 'Unclaimed_Character')
self.assertEqual(user.profile.main_character, self.unclaimed_character)
def test_authenticate_character_record(self):
t = Token(character_id=self.unclaimed_character.character_id, character_name=self.unclaimed_character.character_name, character_owner_hash='4')
OwnershipRecord.objects.create(user=self.old_user, character=self.unclaimed_character, owner_hash='4')
user = StateBackend().authenticate(token=t)
self.assertEqual(user, self.old_user)
self.assertTrue(CharacterOwnership.objects.filter(owner_hash='4', user=self.old_user).exists())
self.assertTrue(user.profile.main_character)
def test_iterate_username(self):
t = Token(character_id=self.unclaimed_character.character_id,
character_name=self.unclaimed_character.character_name, character_owner_hash='3')
username = StateBackend().authenticate(token=t).username
t.character_owner_hash = '4'
username_1 = StateBackend().authenticate(token=t).username
t.character_owner_hash = '5'
username_2 = StateBackend().authenticate(token=t).username
self.assertNotEqual(username, username_1, username_2)
self.assertTrue(username_1.endswith('_1'))
self.assertTrue(username_2.endswith('_2'))

View File

@@ -0,0 +1,35 @@
from io import StringIO
from django.core.management import call_command
from django.test import TestCase
from allianceauth.tests.auth_utils import AuthUtils
from ..models import CharacterOwnership, UserProfile
class ManagementCommandTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test user', disconnect_signals=True)
AuthUtils.add_main_character(cls.user, 'test character', '1', '2', 'test corp', 'test')
character = UserProfile.objects.get(user=cls.user).main_character
CharacterOwnership.objects.create(user=cls.user, character=character, owner_hash='test')
def setUp(self):
self.stdout = StringIO()
def test_ownership(self):
call_command('checkmains', stdout=self.stdout)
self.assertFalse(UserProfile.objects.filter(main_character__isnull=True).count())
self.assertNotIn(self.user.username, self.stdout.getvalue())
self.assertIn('All main characters', self.stdout.getvalue())
def test_no_ownership(self):
user = AuthUtils.create_user('v1 user', disconnect_signals=True)
AuthUtils.add_main_character(user, 'v1 character', '10', '20', 'test corp', 'test')
self.assertFalse(UserProfile.objects.filter(main_character__isnull=True).count())
call_command('checkmains', stdout=self.stdout)
self.assertEqual(UserProfile.objects.filter(main_character__isnull=True).count(), 1)
self.assertIn(user.username, self.stdout.getvalue())

View File

@@ -0,0 +1,68 @@
from unittest import mock
from urllib import parse
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.http.response import HttpResponse
from django.shortcuts import reverse
from django.test import TestCase
from django.test.client import RequestFactory
from allianceauth.eveonline.models import EveCharacter
from allianceauth.tests.auth_utils import AuthUtils
from ..decorators import main_character_required
from ..models import CharacterOwnership
MODULE_PATH = 'allianceauth.authentication'
class DecoratorTestCase(TestCase):
@staticmethod
@main_character_required
def dummy_view(*args, **kwargs):
return HttpResponse(status=200)
@classmethod
def setUpTestData(cls):
cls.main_user = AuthUtils.create_user('main_user', disconnect_signals=True)
cls.no_main_user = AuthUtils.create_user(
'no_main_user', disconnect_signals=True
)
main_character = EveCharacter.objects.create(
character_id=1,
character_name='Main Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
CharacterOwnership.objects.create(
user=cls.main_user, character=main_character, owner_hash='1'
)
cls.main_user.profile.main_character = main_character
def setUp(self):
self.request = RequestFactory().get('/test/')
@mock.patch(MODULE_PATH + '.decorators.messages')
def test_login_redirect(self, m):
setattr(self.request, 'user', AnonymousUser())
response = self.dummy_view(self.request)
self.assertEqual(response.status_code, 302)
url = getattr(response, 'url', None)
self.assertEqual(parse.urlparse(url).path, reverse(settings.LOGIN_URL))
@mock.patch(MODULE_PATH + '.decorators.messages')
def test_main_character_redirect(self, m):
setattr(self.request, 'user', self.no_main_user)
response = self.dummy_view(self.request)
self.assertEqual(response.status_code, 302)
url = getattr(response, 'url', None)
self.assertEqual(url, reverse('authentication:dashboard'))
@mock.patch(MODULE_PATH + '.decorators.messages')
def test_successful_request(self, m):
setattr(self.request, 'user', self.main_user)
response = self.dummy_view(self.request)
self.assertEqual(response.status_code, 200)

View File

@@ -1,147 +1,20 @@
from unittest import mock
from io import StringIO
from urllib import parse
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, User
from django.core.management import call_command
from django.http.response import HttpResponse
from django.shortcuts import reverse
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import RequestFactory
from allianceauth.authentication.decorators import main_character_required
from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo,\
EveAllianceInfo
from allianceauth.tests.auth_utils import AuthUtils
from esi.errors import IncompleteResponseError
from esi.models import Token
from ..backends import StateBackend
from ..models import CharacterOwnership, UserProfile, State, get_guest_state,\
OwnershipRecord
from ..models import CharacterOwnership, State, get_guest_state
from ..tasks import check_character_ownership
MODULE_PATH = 'allianceauth.authentication'
class DecoratorTestCase(TestCase):
@staticmethod
@main_character_required
def dummy_view(*args, **kwargs):
return HttpResponse(status=200)
@classmethod
def setUpTestData(cls):
cls.main_user = AuthUtils.create_user('main_user', disconnect_signals=True)
cls.no_main_user = AuthUtils.create_user('no_main_user', disconnect_signals=True)
main_character = EveCharacter.objects.create(
character_id=1,
character_name='Main Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
CharacterOwnership.objects.create(user=cls.main_user, character=main_character, owner_hash='1')
cls.main_user.profile.main_character = main_character
def setUp(self):
self.request = RequestFactory().get('/test/')
@mock.patch(MODULE_PATH + '.decorators.messages')
def test_login_redirect(self, m):
setattr(self.request, 'user', AnonymousUser())
response = self.dummy_view(self.request)
self.assertEqual(response.status_code, 302)
url = getattr(response, 'url', None)
self.assertEqual(parse.urlparse(url).path, reverse(settings.LOGIN_URL))
@mock.patch(MODULE_PATH + '.decorators.messages')
def test_main_character_redirect(self, m):
setattr(self.request, 'user', self.no_main_user)
response = self.dummy_view(self.request)
self.assertEqual(response.status_code, 302)
url = getattr(response, 'url', None)
self.assertEqual(url, reverse('authentication:dashboard'))
@mock.patch(MODULE_PATH + '.decorators.messages')
def test_successful_request(self, m):
setattr(self.request, 'user', self.main_user)
response = self.dummy_view(self.request)
self.assertEqual(response.status_code, 200)
class BackendTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.main_character = EveCharacter.objects.create(
character_id=1,
character_name='Main Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
cls.alt_character = EveCharacter.objects.create(
character_id=2,
character_name='Alt Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
cls.unclaimed_character = EveCharacter.objects.create(
character_id=3,
character_name='Unclaimed Character',
corporation_id=1,
corporation_name='Corp',
corporation_ticker='CORP',
)
cls.user = AuthUtils.create_user('test_user', disconnect_signals=True)
cls.old_user = AuthUtils.create_user('old_user', disconnect_signals=True)
AuthUtils.disconnect_signals()
CharacterOwnership.objects.create(user=cls.user, character=cls.main_character, owner_hash='1')
CharacterOwnership.objects.create(user=cls.user, character=cls.alt_character, owner_hash='2')
UserProfile.objects.update_or_create(user=cls.user, defaults={'main_character': cls.main_character})
AuthUtils.connect_signals()
def test_authenticate_main_character(self):
t = Token(character_id=self.main_character.character_id, character_owner_hash='1')
user = StateBackend().authenticate(token=t)
self.assertEquals(user, self.user)
def test_authenticate_alt_character(self):
t = Token(character_id=self.alt_character.character_id, character_owner_hash='2')
user = StateBackend().authenticate(token=t)
self.assertEquals(user, self.user)
def test_authenticate_unclaimed_character(self):
t = Token(character_id=self.unclaimed_character.character_id, character_name=self.unclaimed_character.character_name, character_owner_hash='3')
user = StateBackend().authenticate(token=t)
self.assertNotEqual(user, self.user)
self.assertEqual(user.username, 'Unclaimed_Character')
self.assertEqual(user.profile.main_character, self.unclaimed_character)
def test_authenticate_character_record(self):
t = Token(character_id=self.unclaimed_character.character_id, character_name=self.unclaimed_character.character_name, character_owner_hash='4')
record = OwnershipRecord.objects.create(user=self.old_user, character=self.unclaimed_character, owner_hash='4')
user = StateBackend().authenticate(token=t)
self.assertEqual(user, self.old_user)
self.assertTrue(CharacterOwnership.objects.filter(owner_hash='4', user=self.old_user).exists())
self.assertTrue(user.profile.main_character)
def test_iterate_username(self):
t = Token(character_id=self.unclaimed_character.character_id,
character_name=self.unclaimed_character.character_name, character_owner_hash='3')
username = StateBackend().authenticate(token=t).username
t.character_owner_hash = '4'
username_1 = StateBackend().authenticate(token=t).username
t.character_owner_hash = '5'
username_2 = StateBackend().authenticate(token=t).username
self.assertNotEqual(username, username_1, username_2)
self.assertTrue(username_1.endswith('_1'))
self.assertTrue(username_2.endswith('_2'))
class CharacterOwnershipTestCase(TestCase):
@classmethod
def setUpTestData(cls):
@@ -343,10 +216,10 @@ class CharacterOwnershipCheckTestCase(TestCase):
cls.user = AuthUtils.create_user('test_user', disconnect_signals=True)
AuthUtils.add_main_character(cls.user, 'Test Character', '1', corp_id='1', alliance_id='1',
corp_name='Test Corp', alliance_name='Test Alliance')
cls.character = EveCharacter.objects.get(character_id='1')
cls.character = EveCharacter.objects.get(character_id=1)
cls.token = Token.objects.create(
user=cls.user,
character_id='1',
character_id=1,
character_name='Test',
character_owner_hash='1',
)
@@ -378,30 +251,3 @@ class CharacterOwnershipCheckTestCase(TestCase):
filter.return_value.exists.return_value = False
check_character_ownership(self.ownership)
self.assertTrue(filter.return_value.delete.called)
class ManagementCommandTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test user', disconnect_signals=True)
AuthUtils.add_main_character(cls.user, 'test character', '1', '2', 'test corp', 'test')
character = UserProfile.objects.get(user=cls.user).main_character
CharacterOwnership.objects.create(user=cls.user, character=character, owner_hash='test')
def setUp(self):
self.stdout = StringIO()
def test_ownership(self):
call_command('checkmains', stdout=self.stdout)
self.assertFalse(UserProfile.objects.filter(main_character__isnull=True).count())
self.assertNotIn(self.user.username, self.stdout.getvalue())
self.assertIn('All main characters', self.stdout.getvalue())
def test_no_ownership(self):
user = AuthUtils.create_user('v1 user', disconnect_signals=True)
AuthUtils.add_main_character(user, 'v1 character', '10', '20', 'test corp', 'test')
self.assertFalse(UserProfile.objects.filter(main_character__isnull=True).count())
call_command('checkmains', stdout=self.stdout)
self.assertEqual(UserProfile.objects.filter(main_character__isnull=True).count(), 1)
self.assertIn(user.username, self.stdout.getvalue())

View File

@@ -0,0 +1,290 @@
from math import ceil
from unittest.mock import patch
from requests import RequestException
import requests_mock
from packaging.version import Version as Pep440Version
from django.test import TestCase
from allianceauth.templatetags.admin_status import (
status_overview,
_fetch_list_from_gitlab,
_current_notifications,
_current_version_summary,
_fetch_notification_issues_from_gitlab,
_fetch_tags_from_gitlab,
_latests_versions
)
MODULE_PATH = 'allianceauth.templatetags'
def create_tags_list(tag_names: list):
return [{'name': str(tag_name)} for tag_name in tag_names]
GITHUB_TAGS = create_tags_list(['v2.4.6a1', 'v2.4.5', 'v2.4.0', 'v2.0.0', 'v1.1.1'])
GITHUB_NOTIFICATION_ISSUES = [
{
'id': 1,
'title': 'first issue'
},
{
'id': 2,
'title': 'second issue'
},
{
'id': 3,
'title': 'third issue'
},
{
'id': 4,
'title': 'forth issue'
},
{
'id': 5,
'title': 'fifth issue'
},
{
'id': 6,
'title': 'sixth issue'
},
]
TEST_VERSION = '2.6.5'
class TestStatusOverviewTag(TestCase):
@patch(MODULE_PATH + '.admin_status.__version__', TEST_VERSION)
@patch(MODULE_PATH + '.admin_status._fetch_celery_queue_length')
@patch(MODULE_PATH + '.admin_status._current_version_summary')
@patch(MODULE_PATH + '.admin_status._current_notifications')
def test_status_overview(
self,
mock_current_notifications,
mock_current_version_info,
mock_fetch_celery_queue_length
):
notifications = {
'notifications': GITHUB_NOTIFICATION_ISSUES[:5]
}
mock_current_notifications.return_value = notifications
version_info = {
'latest_major': True,
'latest_minor': True,
'latest_patch': True,
'latest_beta': False,
'current_version': TEST_VERSION,
'latest_major_version': '2.4.5',
'latest_minor_version': '2.4.0',
'latest_patch_version': '2.4.5',
'latest_beta_version': '2.4.4a1',
}
mock_current_version_info.return_value = version_info
mock_fetch_celery_queue_length.return_value = 3
result = status_overview()
expected = {
'notifications': GITHUB_NOTIFICATION_ISSUES[:5],
'latest_major': True,
'latest_minor': True,
'latest_patch': True,
'latest_beta': False,
'current_version': TEST_VERSION,
'latest_major_version': '2.4.5',
'latest_minor_version': '2.4.0',
'latest_patch_version': '2.4.5',
'latest_beta_version': '2.4.4a1',
'task_queue_length': 3,
}
self.assertEqual(result, expected)
class TestNotifications(TestCase):
@requests_mock.mock()
def test_fetch_notification_issues_from_gitlab(self, requests_mocker):
url = (
'https://gitlab.com/api/v4/projects/allianceauth%2Fallianceauth/issues'
'?labels=announcement'
)
requests_mocker.get(url, json=GITHUB_NOTIFICATION_ISSUES)
result = _fetch_notification_issues_from_gitlab()
self.assertEqual(result, GITHUB_NOTIFICATION_ISSUES)
@patch(MODULE_PATH + '.admin_status.cache')
def test_current_notifications_normal(self, mock_cache):
mock_cache.get_or_set.return_value = GITHUB_NOTIFICATION_ISSUES
result = _current_notifications()
self.assertEqual(result['notifications'], GITHUB_NOTIFICATION_ISSUES[:5])
@patch(MODULE_PATH + '.admin_status.cache')
def test_current_notifications_failed(self, mock_cache):
mock_cache.get_or_set.side_effect = RequestException
result = _current_notifications()
self.assertEqual(result['notifications'], list())
@patch(MODULE_PATH + '.admin_status.cache')
def test_current_notifications_is_none(self, mock_cache):
mock_cache.get_or_set.return_value = None
result = _current_notifications()
self.assertEqual(result['notifications'], list())
class TestCeleryQueueLength(TestCase):
def test_get_celery_queue_length(self):
pass
class TestVersionTags(TestCase):
@patch(MODULE_PATH + '.admin_status.__version__', TEST_VERSION)
@patch(MODULE_PATH + '.admin_status.cache')
def test_current_version_info_normal(self, mock_cache):
mock_cache.get_or_set.return_value = GITHUB_TAGS
result = _current_version_summary()
self.assertTrue(result['latest_major'])
self.assertTrue(result['latest_minor'])
self.assertTrue(result['latest_patch'])
self.assertEqual(result['latest_major_version'], '2.0.0')
self.assertEqual(result['latest_minor_version'], '2.4.0')
self.assertEqual(result['latest_patch_version'], '2.4.5')
self.assertEqual(result['latest_beta_version'], '2.4.6a1')
@patch(MODULE_PATH + '.admin_status.__version__', TEST_VERSION)
@patch(MODULE_PATH + '.admin_status.cache')
def test_current_version_info_failed(self, mock_cache):
mock_cache.get_or_set.side_effect = RequestException
expected = {}
result = _current_version_summary()
self.assertEqual(result, expected)
@requests_mock.mock()
def test_fetch_tags_from_gitlab(self, requests_mocker):
url = (
'https://gitlab.com/api/v4/projects/allianceauth%2Fallianceauth'
'/repository/tags'
)
requests_mocker.get(url, json=GITHUB_TAGS)
result = _fetch_tags_from_gitlab()
self.assertEqual(result, GITHUB_TAGS)
@patch(MODULE_PATH + '.admin_status.__version__', TEST_VERSION)
@patch(MODULE_PATH + '.admin_status.cache')
def test_current_version_info_return_no_data(self, mock_cache):
mock_cache.get_or_set.return_value = None
expected = {}
result = _current_version_summary()
self.assertEqual(result, expected)
class TestLatestsVersion(TestCase):
def test_all_version_types_defined(self):
tags = create_tags_list(
['2.1.1', '2.1.0', '2.0.0', '2.1.1a1', '1.1.1', '1.1.0', '1.0.0']
)
major, minor, patch, beta = _latests_versions(tags)
self.assertEqual(major, Pep440Version('2.0.0'))
self.assertEqual(minor, Pep440Version('2.1.0'))
self.assertEqual(patch, Pep440Version('2.1.1'))
self.assertEqual(beta, Pep440Version('2.1.1a1'))
def test_major_and_minor_not_defined_with_zero(self):
tags = create_tags_list(
['2.1.2', '2.1.1', '2.0.1', '2.1.1a1', '1.1.1', '1.1.0', '1.0.0']
)
major, minor, patch, beta = _latests_versions(tags)
self.assertEqual(major, Pep440Version('2.0.1'))
self.assertEqual(minor, Pep440Version('2.1.1'))
self.assertEqual(patch, Pep440Version('2.1.2'))
self.assertEqual(beta, Pep440Version('2.1.1a1'))
def test_can_ignore_invalid_versions(self):
tags = create_tags_list(
['2.1.1', '2.1.0', '2.0.0', '2.1.1a1', 'invalid']
)
major, minor, patch, beta = _latests_versions(tags)
self.assertEqual(major, Pep440Version('2.0.0'))
self.assertEqual(minor, Pep440Version('2.1.0'))
self.assertEqual(patch, Pep440Version('2.1.1'))
self.assertEqual(beta, Pep440Version('2.1.1a1'))
class TestFetchListFromGitlab(TestCase):
page_size = 2
def setUp(self):
self.url = (
'https://gitlab.com/api/v4/projects/allianceauth%2Fallianceauth'
'/repository/tags'
)
@classmethod
def my_callback(cls, request, context):
page = int(request.qs['page'][0])
start = (page - 1) * cls.page_size
end = start + cls.page_size
return GITHUB_TAGS[start:end]
@requests_mock.mock()
def test_can_fetch_one_page_with_header(self, requests_mocker):
headers = {
'x-total-pages': '1'
}
requests_mocker.get(self.url, json=GITHUB_TAGS, headers=headers)
result = _fetch_list_from_gitlab(self.url)
self.assertEqual(result, GITHUB_TAGS)
self.assertEqual(requests_mocker.call_count, 1)
@requests_mock.mock()
def test_can_fetch_one_page_wo_header(self, requests_mocker):
requests_mocker.get(self.url, json=GITHUB_TAGS)
result = _fetch_list_from_gitlab(self.url)
self.assertEqual(result, GITHUB_TAGS)
self.assertEqual(requests_mocker.call_count, 1)
@requests_mock.mock()
def test_can_fetch_one_page_and_ignore_invalid_header(self, requests_mocker):
headers = {
'x-total-pages': 'invalid'
}
requests_mocker.get(self.url, json=GITHUB_TAGS, headers=headers)
result = _fetch_list_from_gitlab(self.url)
self.assertEqual(result, GITHUB_TAGS)
self.assertEqual(requests_mocker.call_count, 1)
@requests_mock.mock()
def test_can_fetch_multiple_pages(self, requests_mocker):
total_pages = ceil(len(GITHUB_TAGS) / self.page_size)
headers = {
'x-total-pages': str(total_pages)
}
requests_mocker.get(self.url, json=self.my_callback, headers=headers)
result = _fetch_list_from_gitlab(self.url)
self.assertEqual(result, GITHUB_TAGS)
self.assertEqual(requests_mocker.call_count, total_pages)
@requests_mock.mock()
def test_can_fetch_given_number_of_pages_only(self, requests_mocker):
total_pages = ceil(len(GITHUB_TAGS) / self.page_size)
headers = {
'x-total-pages': str(total_pages)
}
requests_mocker.get(self.url, json=self.my_callback, headers=headers)
max_pages = 2
result = _fetch_list_from_gitlab(self.url, max_pages=max_pages)
self.assertEqual(result, GITHUB_TAGS[:4])
self.assertEqual(requests_mocker.call_count, max_pages)

View File

@@ -22,13 +22,6 @@ urlpatterns = [
r'^account/characters/add/$',
views.add_character,
name='add_character'
),
url(
r'^help/$',
login_required(
TemplateView.as_view(template_name='allianceauth/help.html')
),
name='help'
),
),
url(r'^dashboard/$', views.dashboard, name='dashboard'),
]

View File

@@ -6,20 +6,20 @@ from django.contrib.auth import login, authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core import signing
from django.urls import reverse
from django.urls import reverse, reverse_lazy
from django.shortcuts import redirect, render
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from allianceauth.eveonline.models import EveCharacter
from esi.decorators import token_required
from esi.models import Token
from registration.backends.hmac.views import (
from django_registration.backends.activation.views import (
RegistrationView as BaseRegistrationView,
ActivationView as BaseActivationView,
REGISTRATION_SALT
)
from registration.signals import user_registered
from django_registration.signals import user_registered
from .models import CharacterOwnership
from .forms import RegistrationForm
@@ -69,7 +69,10 @@ def main_character_change(request, token):
if not CharacterOwnership.objects.filter(character__character_id=token.character_id).exists():
co = CharacterOwnership.objects.create_by_token(token)
else:
messages.error(request, 'Cannot change main character to %(char)s: character owned by a different account.' % ({'char': token.character_name}))
messages.error(
request,
_('Cannot change main character to %(char)s: character owned by a different account.') % ({'char': token.character_name})
)
co = None
if co:
request.user.profile.main_character = co.character
@@ -131,11 +134,14 @@ def sso_login(request, token):
# Step 2
class RegistrationView(BaseRegistrationView):
form_class = RegistrationForm
success_url = 'authentication:dashboard'
template_name = "public/register.html"
email_body_template = "registration/activation_email.txt"
email_subject_template = "registration/activation_email_subject.txt"
success_url = reverse_lazy('registration_complete')
def get_success_url(self, user):
if not getattr(settings, 'REGISTRATION_VERIFY_EMAIL', True):
return 'authentication:dashboard', (), {}
return reverse_lazy('authentication:dashboard')
return super().get_success_url(user)
def dispatch(self, request, *args, **kwargs):
@@ -173,6 +179,9 @@ class RegistrationView(BaseRegistrationView):
# Step 3
class ActivationView(BaseActivationView):
template_name = "registration/activate.html"
success_url = reverse_lazy('registration_activation_complete')
def validate_key(self, activation_key):
try:
dump = signing.loads(activation_key, salt=REGISTRATION_SALT,
@@ -204,5 +213,5 @@ def activation_complete(request):
def registration_closed(request):
messages.error(request, _('Registraion of new accounts it not allowed at this time.'))
messages.error(request, _('Registration of new accounts is not allowed at this time.'))
return redirect('authentication:login')

View File

@@ -8,7 +8,7 @@ class CorpStats(MenuItemHook):
def __init__(self):
MenuItemHook.__init__(self,
_('Corporation Stats'),
'fa fa-share-alt fa-fw',
'fas fa-share-alt fa-fw',
'corputils:view',
navactive=['corputils:'])

File diff suppressed because one or more lines are too long

View File

@@ -17,9 +17,9 @@ class CorpStatsManagerTestCase(TestCase):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST')
cls.user.profile.refresh_from_db()
cls.alliance = EveAllianceInfo.objects.create(alliance_id='3', alliance_name='test alliance', alliance_ticker='TEST', executor_corp_id='2')
cls.corp = EveCorporationInfo.objects.create(corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', alliance=cls.alliance, member_count=1)
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id='1', character_name='test character', character_owner_hash='z')
cls.alliance = EveAllianceInfo.objects.create(alliance_id=3, alliance_name='test alliance', alliance_ticker='TEST', executor_corp_id=2)
cls.corp = EveCorporationInfo.objects.create(corporation_id=2, corporation_name='test corp', corporation_ticker='TEST', alliance=cls.alliance, member_count=1)
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id=1, character_name='test character', character_owner_hash='z')
cls.corpstats = CorpStats.objects.create(corp=cls.corp, token=cls.token)
cls.view_corp_permission = Permission.objects.get_by_natural_key('view_corp_corpstats', 'corputils', 'corpstats')
cls.view_alliance_permission = Permission.objects.get_by_natural_key('view_alliance_corpstats', 'corputils', 'corpstats')
@@ -66,9 +66,9 @@ class CorpStatsUpdateTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST')
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id='1', character_name='test character', character_owner_hash='z')
cls.corp = EveCorporationInfo.objects.create(corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', member_count=1)
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id=2, corp_name='test_corp', corp_ticker='TEST', alliance_id=3, alliance_name='TEST')
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id=1, character_name='test character', character_owner_hash='z')
cls.corp = EveCorporationInfo.objects.create(corporation_id=2, corporation_name='test corp', corporation_ticker='TEST', member_count=1)
def setUp(self):
self.corpstats = CorpStats.objects.get_or_create(token=self.token, corp=self.corp)[0]
@@ -88,11 +88,11 @@ class CorpStatsUpdateTestCase(TestCase):
SwaggerClient.from_spec.return_value.Corporation.get_corporations_corporation_id_members.return_value.result.return_value = [1]
SwaggerClient.from_spec.return_value.Universe.post_universe_names.return_value.result.return_value = [{'id': 1, 'name': 'test character'}]
self.corpstats.update()
self.assertTrue(CorpMember.objects.filter(character_id='1', character_name='test character', corpstats=self.corpstats).exists())
self.assertTrue(CorpMember.objects.filter(character_id=1, character_name='test character', corpstats=self.corpstats).exists())
@mock.patch('esi.clients.SwaggerClient')
def test_update_remove_member(self, SwaggerClient):
CorpMember.objects.create(character_id='2', character_name='old test character', corpstats=self.corpstats)
CorpMember.objects.create(character_id=2, character_name='old test character', corpstats=self.corpstats)
SwaggerClient.from_spec.return_value.Character.get_characters_character_id.return_value.result.return_value = {'corporation_id': 2}
SwaggerClient.from_spec.return_value.Corporation.get_corporations_corporation_id_members.return_value.result.return_value = [1]
SwaggerClient.from_spec.return_value.Universe.post_universe_names.return_value.result.return_value = [{'id': 1, 'name': 'test character'}]
@@ -130,15 +130,15 @@ class CorpStatsPropertiesTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id=2, corp_name='test_corp', corp_ticker='TEST', alliance_id=3, alliance_name='TEST')
cls.user.profile.refresh_from_db()
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id='1', character_name='test character', character_owner_hash='z')
cls.corp = EveCorporationInfo.objects.create(corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', member_count=1)
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id=1, character_name='test character', character_owner_hash='z')
cls.corp = EveCorporationInfo.objects.create(corporation_id=2, corporation_name='test corp', corporation_ticker='TEST', member_count=1)
cls.corpstats = CorpStats.objects.create(token=cls.token, corp=cls.corp)
cls.character = EveCharacter.objects.create(character_name='another test character', character_id='4', corporation_id='2', corporation_name='test corp', corporation_ticker='TEST')
cls.character = EveCharacter.objects.create(character_name='another test character', character_id=4, corporation_id=2, corporation_name='test corp', corporation_ticker='TEST')
def test_member_count(self):
member = CorpMember.objects.create(corpstats=self.corpstats, character_id='1', character_name='test character')
member = CorpMember.objects.create(corpstats=self.corpstats, character_id=2, character_name='test character')
self.assertEqual(self.corpstats.member_count, 1)
member.delete()
self.assertEqual(self.corpstats.member_count, 0)
@@ -147,7 +147,7 @@ class CorpStatsPropertiesTestCase(TestCase):
AuthUtils.disconnect_signals()
co = CharacterOwnership.objects.create(character=self.character, user=self.user, owner_hash='a')
AuthUtils.connect_signals()
CorpMember.objects.create(corpstats=self.corpstats, character_id='4', character_name='test character')
CorpMember.objects.create(corpstats=self.corpstats, character_id=4, character_name='test character')
self.assertEqual(self.corpstats.user_count, 1)
co.delete()
self.assertEqual(self.corpstats.user_count, 0)
@@ -156,7 +156,8 @@ class CorpStatsPropertiesTestCase(TestCase):
AuthUtils.disconnect_signals()
co = CharacterOwnership.objects.create(character=self.character, user=self.user, owner_hash='a')
AuthUtils.connect_signals()
member = CorpMember.objects.create(corpstats=self.corpstats, character_id='4', character_name='test character')
member = CorpMember.objects.create(corpstats=self.corpstats, character_id=4, character_name='test character')
self.corpstats.refresh_from_db()
self.assertIn(member, self.corpstats.registered_members)
self.assertEqual(self.corpstats.registered_member_count, 1)
@@ -165,7 +166,7 @@ class CorpStatsPropertiesTestCase(TestCase):
self.assertEqual(self.corpstats.registered_member_count, 0)
def test_unregistered_members(self):
member = CorpMember.objects.create(corpstats=self.corpstats, character_id='4', character_name='test character')
member = CorpMember.objects.create(corpstats=self.corpstats, character_id=4, character_name='test character')
self.corpstats.refresh_from_db()
self.assertIn(member, self.corpstats.unregistered_members)
self.assertEqual(self.corpstats.unregistered_member_count, 1)
@@ -178,13 +179,13 @@ class CorpStatsPropertiesTestCase(TestCase):
def test_mains(self):
# test when is a main
member = CorpMember.objects.create(corpstats=self.corpstats, character_id='1', character_name='test character')
member = CorpMember.objects.create(corpstats=self.corpstats, character_id=1, character_name='test character')
self.assertIn(member, self.corpstats.mains)
self.assertEqual(self.corpstats.main_count, 1)
# test when is an alt
old_main = self.user.profile.main_character
character = EveCharacter.objects.create(character_name='other character', character_id=10, corporation_name='test corp', corporation_id='2', corporation_ticker='TEST')
character = EveCharacter.objects.create(character_name='other character', character_id=10, corporation_name='test corp', corporation_id=2, corporation_ticker='TEST')
AuthUtils.disconnect_signals()
co = CharacterOwnership.objects.create(character=character, user=self.user, owner_hash='b')
self.user.profile.main_character = character
@@ -208,7 +209,7 @@ class CorpStatsPropertiesTestCase(TestCase):
self.assertEqual(self.corpstats.corp_logo(size=128), 'https://images.evetech.net/corporations/2/logo?size=128')
self.assertEqual(self.corpstats.alliance_logo(size=128), 'https://images.evetech.net/alliances/1/logo?size=128')
alliance = EveAllianceInfo.objects.create(alliance_name='test alliance', alliance_id='3', alliance_ticker='TEST', executor_corp_id='2')
alliance = EveAllianceInfo.objects.create(alliance_name='test alliance', alliance_id=3, alliance_ticker='TEST', executor_corp_id=2)
self.corp.alliance = alliance
self.corp.save()
self.assertEqual(self.corpstats.alliance_logo(size=128), 'https://images.evetech.net/alliances/3/logo?size=128')
@@ -221,14 +222,14 @@ class CorpMemberTestCase(TestCase):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST')
cls.user.profile.refresh_from_db()
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id='1', character_name='test character', character_owner_hash='a')
cls.corp = EveCorporationInfo.objects.create(corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', member_count=1)
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id=1, character_name='test character', character_owner_hash='a')
cls.corp = EveCorporationInfo.objects.create(corporation_id=2, corporation_name='test corp', corporation_ticker='TEST', member_count=1)
cls.corpstats = CorpStats.objects.create(token=cls.token, corp=cls.corp)
cls.member = CorpMember.objects.create(corpstats=cls.corpstats, character_id='2', character_name='other test character')
cls.member = CorpMember.objects.create(corpstats=cls.corpstats, character_id=2, character_name='other test character')
def test_character(self):
self.assertIsNone(self.member.character)
character = EveCharacter.objects.create(character_id='2', character_name='other test character', corporation_id='2', corporation_name='test corp', corporation_ticker='TEST')
character = EveCharacter.objects.create(character_id=2, character_name='other test character', corporation_id=2, corporation_name='test corp', corporation_ticker='TEST')
self.assertEqual(self.member.character, character)
def test_main_character(self):
@@ -238,7 +239,7 @@ class CorpMemberTestCase(TestCase):
self.assertIsNone(self.member.main_character)
# test when member.character is not None but also not a main
character = EveCharacter.objects.create(character_id='2', character_name='other test character', corporation_id='2', corporation_name='test corp', corporation_ticker='TEST')
character = EveCharacter.objects.create(character_id=2, character_name='other test character', corporation_id=2, corporation_name='test corp', corporation_ticker='TEST')
CharacterOwnership.objects.create(character=character, user=self.user, owner_hash='b')
self.member.refresh_from_db()
self.assertNotEqual(self.member.main_character, self.member.character)
@@ -260,14 +261,14 @@ class CorpMemberTestCase(TestCase):
def test_alts(self):
self.assertListEqual(self.member.alts, [])
character = EveCharacter.objects.create(character_id='2', character_name='other test character', corporation_id='2', corporation_name='test corp', corporation_ticker='TEST')
character = EveCharacter.objects.create(character_id=2, character_name='other test character', corporation_id=2, corporation_name='test corp', corporation_ticker='TEST')
CharacterOwnership.objects.create(character=character, user=self.user, owner_hash='b')
self.assertIn(character, self.member.alts)
def test_registered(self):
self.assertFalse(self.member.registered)
AuthUtils.disconnect_signals()
character = EveCharacter.objects.create(character_id='2', character_name='other test character', corporation_id='2', corporation_name='test corp', corporation_ticker='TEST')
character = EveCharacter.objects.create(character_id=2, character_name='other test character', corporation_id=2, corporation_name='test corp', corporation_ticker='TEST')
CharacterOwnership.objects.create(character=character, user=self.user, owner_hash='b')
self.assertTrue(self.member.registered)
AuthUtils.connect_signals()

View File

@@ -4,14 +4,14 @@
# It contains of modules for views and templatetags for templates
# list of all eve entity categories as defined in ESI
ESI_CATEGORY_AGENT = "agent"
ESI_CATEGORY_ALLIANCE = "alliance"
ESI_CATEGORY_CHARACTER = "character"
ESI_CATEGORY_CONSTELLATION = "constellation"
ESI_CATEGORY_CORPORATION = "corporation"
ESI_CATEGORY_FACTION = "faction"
ESI_CATEGORY_INVENTORYTYPE = "inventory_type"
ESI_CATEGORY_REGION = "region"
ESI_CATEGORY_SOLARSYSTEM = "solar_system"
ESI_CATEGORY_STATION = "station"
ESI_CATEGORY_WORMHOLE = "wormhole"
_ESI_CATEGORY_AGENT = "agent"
_ESI_CATEGORY_ALLIANCE = "alliance"
_ESI_CATEGORY_CHARACTER = "character"
_ESI_CATEGORY_CONSTELLATION = "constellation"
_ESI_CATEGORY_CORPORATION = "corporation"
_ESI_CATEGORY_FACTION = "faction"
_ESI_CATEGORY_INVENTORYTYPE = "inventory_type"
_ESI_CATEGORY_REGION = "region"
_ESI_CATEGORY_SOLARSYSTEM = "solar_system"
_ESI_CATEGORY_STATION = "station"
_ESI_CATEGORY_WORMHOLE = "wormhole"

View File

@@ -2,24 +2,30 @@
from urllib.parse import urljoin, quote
from . import *
from . import (
_ESI_CATEGORY_ALLIANCE,
_ESI_CATEGORY_CORPORATION,
_ESI_CATEGORY_REGION,
_ESI_CATEGORY_SOLARSYSTEM
)
BASE_URL = 'http://evemaps.dotlan.net'
_BASE_URL = 'http://evemaps.dotlan.net'
def _build_url(category: str, name: str) -> str:
"""return url to profile page for an eve entity"""
if category == ESI_CATEGORY_ALLIANCE:
if category == _ESI_CATEGORY_ALLIANCE:
partial = 'alliance'
elif category == ESI_CATEGORY_CORPORATION:
elif category == _ESI_CATEGORY_CORPORATION:
partial = 'corp'
elif category == ESI_CATEGORY_REGION:
elif category == _ESI_CATEGORY_REGION:
partial = 'map'
elif category == ESI_CATEGORY_SOLARSYSTEM:
elif category == _ESI_CATEGORY_SOLARSYSTEM:
partial = 'system'
else:
@@ -28,7 +34,7 @@ def _build_url(category: str, name: str) -> str:
)
url = urljoin(
BASE_URL,
_BASE_URL,
'{}/{}'.format(partial, quote(str(name).replace(" ", "_")))
)
@@ -37,16 +43,19 @@ def _build_url(category: str, name: str) -> str:
def alliance_url(name: str) -> str:
"""url for page about given alliance on dotlan"""
return _build_url(ESI_CATEGORY_ALLIANCE, name)
return _build_url(_ESI_CATEGORY_ALLIANCE, name)
def corporation_url(name: str) -> str:
"""url for page about given corporation on dotlan"""
return _build_url(ESI_CATEGORY_CORPORATION, name)
return _build_url(_ESI_CATEGORY_CORPORATION, name)
def region_url(name: str) -> str:
"""url for page about given region on dotlan"""
return _build_url(ESI_CATEGORY_REGION, name)
return _build_url(_ESI_CATEGORY_REGION, name)
def solar_system_url(name: str) -> str:
"""url for page about given solar system on dotlan"""
return _build_url(ESI_CATEGORY_SOLARSYSTEM, name)
return _build_url(_ESI_CATEGORY_SOLARSYSTEM, name)

View File

@@ -0,0 +1,129 @@
from . import (
_ESI_CATEGORY_ALLIANCE,
_ESI_CATEGORY_CHARACTER,
_ESI_CATEGORY_CORPORATION,
_ESI_CATEGORY_INVENTORYTYPE
)
_EVE_IMAGE_SERVER_URL = 'https://images.evetech.net'
_DEFAULT_IMAGE_SIZE = 32
def _eve_entity_image_url(
category: str,
entity_id: int,
size: int = 32,
variant: str = None,
tenant: str = None,
) -> str:
"""returns image URL for an Eve Online ID.
Supported categories: alliance, corporation, character, inventory_type
Arguments:
- category: category of the ID, see ESI category constants
- entity_id: Eve ID of the entity
- size: (optional) render size of the image.must be between 32 (default) and 1024
- variant: (optional) image variant for category. currently not relevant.
- tenant: (optional) Eve Server, either `tranquility`(default) or `singularity`
Returns:
- URL string for the requested image on the Eve image server
Exceptions:
- Throws ValueError on invalid input
"""
# input validations
categories = {
_ESI_CATEGORY_ALLIANCE: {
'endpoint': 'alliances',
'variants': ['logo']
},
_ESI_CATEGORY_CORPORATION: {
'endpoint': 'corporations',
'variants': ['logo']
},
_ESI_CATEGORY_CHARACTER: {
'endpoint': 'characters',
'variants': ['portrait']
},
_ESI_CATEGORY_INVENTORYTYPE: {
'endpoint': 'types',
'variants': ['icon', 'render']
}
}
tenants = ['tranquility', 'singularity']
if not entity_id:
raise ValueError('Invalid entity_id: {}'.format(entity_id))
else:
entity_id = int(entity_id)
if not size or size < 32 or size > 1024 or (size & (size - 1) != 0):
raise ValueError('Invalid size: {}'.format(size))
if category not in categories:
raise ValueError('Invalid category {}'.format(category))
else:
endpoint = categories[category]['endpoint']
if variant:
if variant not in categories[category]['variants']:
raise ValueError('Invalid variant {} for category {}'.format(
variant,
category
))
else:
variant = categories[category]['variants'][0]
if tenant and tenant not in tenants:
raise ValueError('Invalid tenant {}'.format(tenant))
# compose result URL
result = '{}/{}/{}/{}?size={}'.format(
_EVE_IMAGE_SERVER_URL,
endpoint,
entity_id,
variant,
size
)
if tenant:
result += '&tenant={}'.format(tenant)
return result
def alliance_logo_url(alliance_id: int, size: int = _DEFAULT_IMAGE_SIZE) -> str:
"""image URL for the given alliance ID"""
return _eve_entity_image_url(_ESI_CATEGORY_ALLIANCE, alliance_id, size)
def corporation_logo_url(
corporation_id: int, size: int = _DEFAULT_IMAGE_SIZE
) -> str:
"""image URL for the given corporation ID"""
return _eve_entity_image_url(
_ESI_CATEGORY_CORPORATION, corporation_id, size
)
def character_portrait_url(
character_id: int, size: int = _DEFAULT_IMAGE_SIZE
) -> str:
"""image URL for the given character ID"""
return _eve_entity_image_url(_ESI_CATEGORY_CHARACTER, character_id, size)
def type_icon_url(type_id: int, size: int = _DEFAULT_IMAGE_SIZE) -> str:
"""icon image URL for the given type ID"""
return _eve_entity_image_url(
_ESI_CATEGORY_INVENTORYTYPE, type_id, size, variant='icon'
)
def type_render_url(type_id: int, size: int = _DEFAULT_IMAGE_SIZE) -> str:
"""render image URL for the given type ID"""
return _eve_entity_image_url(
_ESI_CATEGORY_INVENTORYTYPE, type_id, size, variant='render'
)

View File

@@ -1,22 +1,27 @@
# this module generates profile URLs for evewho
from urllib.parse import urljoin, quote
from urllib.parse import urljoin
from . import *
from . import (
_ESI_CATEGORY_ALLIANCE,
_ESI_CATEGORY_CORPORATION,
_ESI_CATEGORY_CHARACTER,
)
BASE_URL = 'https://evewho.com'
_BASE_URL = 'https://evewho.com'
def _build_url(category: str, eve_id: int) -> str:
"""return url to profile page for an eve entity"""
if category == ESI_CATEGORY_ALLIANCE:
if category == _ESI_CATEGORY_ALLIANCE:
partial = 'alliance'
elif category == ESI_CATEGORY_CORPORATION:
elif category == _ESI_CATEGORY_CORPORATION:
partial = 'corporation'
elif category == ESI_CATEGORY_CHARACTER:
elif category == _ESI_CATEGORY_CHARACTER:
partial = 'character'
else:
@@ -25,7 +30,7 @@ def _build_url(category: str, eve_id: int) -> str:
)
url = urljoin(
BASE_URL,
_BASE_URL,
'{}/{}'.format(partial, int(eve_id))
)
return url
@@ -33,12 +38,14 @@ def _build_url(category: str, eve_id: int) -> str:
def alliance_url(eve_id: int) -> str:
"""url for page about given alliance on evewho"""
return _build_url(ESI_CATEGORY_ALLIANCE, eve_id)
return _build_url(_ESI_CATEGORY_ALLIANCE, eve_id)
def character_url(eve_id: int) -> str:
"""url for page about given character on evewho"""
return _build_url(ESI_CATEGORY_CHARACTER, eve_id)
return _build_url(_ESI_CATEGORY_CHARACTER, eve_id)
def corporation_url(eve_id: int) -> str:
"""url for page about given corporation on evewho"""
return _build_url(ESI_CATEGORY_CORPORATION, eve_id)
return _build_url(_ESI_CATEGORY_CORPORATION, eve_id)

View File

@@ -1,7 +1,7 @@
from django.test import TestCase
from ...models import EveCharacter, EveCorporationInfo, EveAllianceInfo
from .. import dotlan, zkillboard, evewho
from .. import dotlan, zkillboard, evewho, eveimageserver
from ...templatetags import evelinks
@@ -90,3 +90,115 @@ class TestZkillboard(TestCase):
'https://zkillboard.com/system/12345678/'
)
class TestEveImageServer(TestCase):
"""unit test for eveimageserver"""
def test_sizes(self):
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42),
'https://images.evetech.net/characters/42/portrait?size=32'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, size=32),
'https://images.evetech.net/characters/42/portrait?size=32'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, size=64),
'https://images.evetech.net/characters/42/portrait?size=64'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, size=128),
'https://images.evetech.net/characters/42/portrait?size=128'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, size=256),
'https://images.evetech.net/characters/42/portrait?size=256'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, size=512),
'https://images.evetech.net/characters/42/portrait?size=512'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, size=1024),
'https://images.evetech.net/characters/42/portrait?size=1024'
)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('corporation', 42, size=-5)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('corporation', 42, size=0)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('corporation', 42, size=31)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('corporation', 42, size=1025)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('corporation', 42, size=2048)
def test_variant(self):
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, variant='portrait'),
'https://images.evetech.net/characters/42/portrait?size=32'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('alliance', 42, variant='logo'),
'https://images.evetech.net/alliances/42/logo?size=32'
)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('character', 42, variant='logo')
def test_alliance(self):
self.assertEqual(
eveimageserver._eve_entity_image_url('alliance', 42),
'https://images.evetech.net/alliances/42/logo?size=32'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('corporation', 42),
'https://images.evetech.net/corporations/42/logo?size=32'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42),
'https://images.evetech.net/characters/42/portrait?size=32'
)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('station', 42)
def test_tenants(self):
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, tenant='tranquility'),
'https://images.evetech.net/characters/42/portrait?size=32&tenant=tranquility'
)
self.assertEqual(
eveimageserver._eve_entity_image_url('character', 42, tenant='singularity'),
'https://images.evetech.net/characters/42/portrait?size=32&tenant=singularity'
)
with self.assertRaises(ValueError):
eveimageserver._eve_entity_image_url('character', 42, tenant='xxx')
def test_alliance_logo_url(self):
expected = 'https://images.evetech.net/alliances/42/logo?size=128'
self.assertEqual(eveimageserver.alliance_logo_url(42, 128), expected)
def test_corporation_logo_url(self):
expected = 'https://images.evetech.net/corporations/42/logo?size=128'
self.assertEqual(eveimageserver.corporation_logo_url(42, 128), expected)
def test_character_portrait_url(self):
expected = 'https://images.evetech.net/characters/42/portrait?size=128'
self.assertEqual(
eveimageserver.character_portrait_url(42, 128), expected
)
def test_type_icon_url(self):
expected = 'https://images.evetech.net/types/42/icon?size=128'
self.assertEqual(eveimageserver.type_icon_url(42, 128), expected)
def test_type_render_url(self):
expected = 'https://images.evetech.net/types/42/render?size=128'
self.assertEqual(eveimageserver.type_render_url(42, 128), expected)

View File

@@ -1,7 +1,7 @@
from django.test import TestCase
from ...models import EveCharacter, EveCorporationInfo, EveAllianceInfo
from .. import dotlan, zkillboard, evewho
from .. import eveimageserver, evewho, dotlan, zkillboard
from ...templatetags import evelinks
@@ -332,3 +332,28 @@ class TestTemplateTags(TestCase):
''
)
def test_type_icon_url(self):
expected = eveimageserver.type_icon_url(123)
self.assertEqual(evelinks.type_icon_url(123), expected)
expected = eveimageserver.type_icon_url(123, 128)
self.assertEqual(evelinks.type_icon_url(123, 128), expected)
expected = ''
self.assertEqual(evelinks.type_icon_url(123, 99), expected)
expected = ''
self.assertEqual(evelinks.type_icon_url(None), expected)
def test_type_render_url(self):
expected = eveimageserver.type_render_url(123)
self.assertEqual(evelinks.type_render_url(123), expected)
expected = eveimageserver.type_render_url(123, 128)
self.assertEqual(evelinks.type_render_url(123, 128), expected)
expected = ''
self.assertEqual(evelinks.type_render_url(123, 99), expected)
expected = ''
self.assertEqual(evelinks.type_render_url(None), expected)

View File

@@ -1,28 +1,35 @@
# this module generates profile URLs for zKillboard
from urllib.parse import urljoin, quote
from urllib.parse import urljoin
from . import *
from . import (
_ESI_CATEGORY_ALLIANCE,
_ESI_CATEGORY_CORPORATION,
_ESI_CATEGORY_CHARACTER,
_ESI_CATEGORY_REGION,
_ESI_CATEGORY_SOLARSYSTEM
)
BASE_URL = 'https://zkillboard.com'
_BASE_URL = 'https://zkillboard.com'
def _build_url(category: str, eve_id: int) -> str:
"""return url to profile page for an eve entity"""
if category == ESI_CATEGORY_ALLIANCE:
if category == _ESI_CATEGORY_ALLIANCE:
partial = 'alliance'
elif category == ESI_CATEGORY_CORPORATION:
elif category == _ESI_CATEGORY_CORPORATION:
partial = 'corporation'
elif category == ESI_CATEGORY_CHARACTER:
elif category == _ESI_CATEGORY_CHARACTER:
partial = 'character'
elif category == ESI_CATEGORY_REGION:
elif category == _ESI_CATEGORY_REGION:
partial = 'region'
elif category == ESI_CATEGORY_SOLARSYSTEM:
elif category == _ESI_CATEGORY_SOLARSYSTEM:
partial = 'system'
else:
@@ -31,7 +38,7 @@ def _build_url(category: str, eve_id: int) -> str:
)
url = urljoin(
BASE_URL,
_BASE_URL,
'{}/{}/'.format(partial, int(eve_id))
)
return url
@@ -39,19 +46,23 @@ def _build_url(category: str, eve_id: int) -> str:
def alliance_url(eve_id: int) -> str:
"""url for page about given alliance on zKillboard"""
return _build_url(ESI_CATEGORY_ALLIANCE, eve_id)
return _build_url(_ESI_CATEGORY_ALLIANCE, eve_id)
def character_url(eve_id: int) -> str:
"""url for page about given character on zKillboard"""
return _build_url(ESI_CATEGORY_CHARACTER, eve_id)
return _build_url(_ESI_CATEGORY_CHARACTER, eve_id)
def corporation_url(eve_id: int) -> str:
"""url for page about given corporation on zKillboard"""
return _build_url(ESI_CATEGORY_CORPORATION, eve_id)
return _build_url(_ESI_CATEGORY_CORPORATION, eve_id)
def region_url(eve_id: int) -> str:
"""url for page about given region on zKillboard"""
return _build_url(ESI_CATEGORY_REGION, eve_id)
return _build_url(_ESI_CATEGORY_REGION, eve_id)
def solar_system_url(eve_id: int) -> str:
return _build_url(ESI_CATEGORY_SOLARSYSTEM, eve_id)
return _build_url(_ESI_CATEGORY_SOLARSYSTEM, eve_id)

View File

@@ -89,4 +89,6 @@ class EveCorporationManager(models.Manager):
)
def update_corporation(self, corp_id):
return self.get(corporation_id=corp_id).update_corporation(self.provider.get_corporation(corp_id))
return self\
.get(corporation_id=corp_id)\
.update_corporation(self.provider.get_corporation(corp_id))

View File

@@ -0,0 +1,43 @@
# Generated by Django 2.2.12 on 2020-05-25 02:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eveonline', '0010_alliance_ticker'),
]
operations = [
migrations.AlterField(
model_name='eveallianceinfo',
name='alliance_id',
field=models.PositiveIntegerField(unique=True),
),
migrations.AlterField(
model_name='eveallianceinfo',
name='executor_corp_id',
field=models.PositiveIntegerField(),
),
migrations.AlterField(
model_name='evecharacter',
name='alliance_id',
field=models.PositiveIntegerField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='evecharacter',
name='character_id',
field=models.PositiveIntegerField(unique=True),
),
migrations.AlterField(
model_name='evecharacter',
name='corporation_id',
field=models.PositiveIntegerField(),
),
migrations.AlterField(
model_name='evecorporationinfo',
name='corporation_id',
field=models.PositiveIntegerField(unique=True),
),
]

View File

@@ -0,0 +1,33 @@
# Generated by Django 2.2.12 on 2020-05-26 02:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eveonline', '0011_ids_to_integers'),
]
operations = [
migrations.AddIndex(
model_name='eveallianceinfo',
index=models.Index(fields=['executor_corp_id'], name='eveonline_e_executo_7f3280_idx'),
),
migrations.AddIndex(
model_name='evecharacter',
index=models.Index(fields=['corporation_id'], name='eveonline_e_corpora_cb4cd9_idx'),
),
migrations.AddIndex(
model_name='evecharacter',
index=models.Index(fields=['alliance_id'], name='eveonline_e_allianc_39ee2a_idx'),
),
migrations.AddIndex(
model_name='evecharacter',
index=models.Index(fields=['corporation_name'], name='eveonline_e_corpora_893c60_idx'),
),
migrations.AddIndex(
model_name='evecharacter',
index=models.Index(fields=['alliance_name'], name='eveonline_e_allianc_63fd98_idx'),
),
]

View File

@@ -5,109 +5,35 @@ from .managers import EveCharacterManager, EveCharacterProviderManager
from .managers import EveCorporationManager, EveCorporationProviderManager
from .managers import EveAllianceManager, EveAllianceProviderManager
from . import providers
from .evelinks import eveimageserver
EVE_IMAGE_SERVER_URL = 'https://images.evetech.net'
def _eve_entity_image_url(
category: str,
id: int,
size: int = 32,
variant: str = None,
tenant: str = None,
) -> str:
"""returns image URL for an Eve Online ID.
Supported categories: `alliance`, `corporation`, `character`
Arguments:
- category: category of the ID
- id: Eve ID of the entity
- size: (optional) render size of the image.must be between 32 (default) and 1024
- variant: (optional) image variant for category. currently not relevant.
- tentant: (optional) Eve Server, either `tranquility`(default) or `singularity`
Returns:
- URL string for the requested image on the Eve image server
Exceptions:
- Throws ValueError on invalid input
"""
# input validations
categories = {
'alliance': {
'endpoint': 'alliances',
'variants': [
'logo'
]
},
'corporation': {
'endpoint': 'corporations',
'variants': [
'logo'
]
},
'character': {
'endpoint': 'characters',
'variants': [
'portrait'
]
}
}
tenants = ['tranquility', 'singularity']
if size < 32 or size > 1024 or (size & (size - 1) != 0):
raise ValueError('Invalid size: {}'.format(size))
if category not in categories:
raise ValueError('Invalid category {}'.format(category))
else:
endpoint = categories[category]['endpoint']
if variant:
if variant not in categories[category]['variants']:
raise ValueError('Invalid variant {} for category {}'.format(
variant,
category
))
else:
variant = categories[category]['variants'][0]
if tenant and tenant not in tenants:
raise ValueError('Invalid tentant {}'.format(tenant))
# compose result URL
result = '{}/{}/{}/{}?size={}'.format(
EVE_IMAGE_SERVER_URL,
endpoint,
id,
variant,
size
)
if tenant:
result += '&tenant={}'.format(tenant)
return result
_DEFAULT_IMAGE_SIZE = 32
class EveAllianceInfo(models.Model):
alliance_id = models.CharField(max_length=254, unique=True)
alliance_id = models.PositiveIntegerField(unique=True)
alliance_name = models.CharField(max_length=254, unique=True)
alliance_ticker = models.CharField(max_length=254)
executor_corp_id = models.CharField(max_length=254)
executor_corp_id = models.PositiveIntegerField()
objects = EveAllianceManager()
provider = EveAllianceProviderManager()
class Meta:
indexes = [models.Index(fields=['executor_corp_id',])]
def populate_alliance(self):
alliance = self.provider.get_alliance(self.alliance_id)
for corp_id in alliance.corp_ids:
if not EveCorporationInfo.objects.filter(corporation_id=corp_id).exists():
EveCorporationInfo.objects.create_corporation(corp_id)
EveCorporationInfo.objects.filter(corporation_id__in=alliance.corp_ids).update(alliance=self)
EveCorporationInfo.objects.filter(alliance=self).exclude(corporation_id__in=alliance.corp_ids).update(
alliance=None)
EveCorporationInfo.objects.filter(
corporation_id__in=alliance.corp_ids).update(alliance=self
)
EveCorporationInfo.objects\
.filter(alliance=self)\
.exclude(corporation_id__in=alliance.corp_ids)\
.update(alliance=None)
def update_alliance(self, alliance: providers.Alliance = None):
if alliance is None:
@@ -120,11 +46,13 @@ class EveAllianceInfo(models.Model):
return self.alliance_name
@staticmethod
def generic_logo_url(alliance_id: int, size: int = 32) -> str:
def generic_logo_url(
alliance_id: int, size: int = _DEFAULT_IMAGE_SIZE
) -> str:
"""image URL for the given alliance ID"""
return _eve_entity_image_url('alliance', alliance_id, size)
return eveimageserver.alliance_logo_url(alliance_id, size)
def logo_url(self, size:int = 32) -> str:
def logo_url(self, size: int = _DEFAULT_IMAGE_SIZE) -> str:
"""image URL of this alliance"""
return self.generic_logo_url(self.alliance_id, size)
@@ -150,11 +78,13 @@ class EveAllianceInfo(models.Model):
class EveCorporationInfo(models.Model):
corporation_id = models.CharField(max_length=254, unique=True)
corporation_id = models.PositiveIntegerField(unique=True)
corporation_name = models.CharField(max_length=254, unique=True)
corporation_ticker = models.CharField(max_length=254)
member_count = models.IntegerField()
alliance = models.ForeignKey(EveAllianceInfo, blank=True, null=True, on_delete=models.SET_NULL)
alliance = models.ForeignKey(
EveAllianceInfo, blank=True, null=True, on_delete=models.SET_NULL
)
objects = EveCorporationManager()
provider = EveCorporationProviderManager()
@@ -174,11 +104,13 @@ class EveCorporationInfo(models.Model):
return self.corporation_name
@staticmethod
def generic_logo_url(corporation_id: int, size: int = 32) -> str:
def generic_logo_url(
corporation_id: int, size: int = _DEFAULT_IMAGE_SIZE
) -> str:
"""image URL for the given corporation ID"""
return _eve_entity_image_url('corporation', corporation_id, size)
return eveimageserver.corporation_logo_url(corporation_id, size)
def logo_url(self, size:int = 32) -> str:
def logo_url(self, size: int = _DEFAULT_IMAGE_SIZE) -> str:
"""image URL for this corporation"""
return self.generic_logo_url(self.corporation_id, size)
@@ -204,18 +136,26 @@ class EveCorporationInfo(models.Model):
class EveCharacter(models.Model):
character_id = models.CharField(max_length=254, unique=True)
character_id = models.PositiveIntegerField(unique=True)
character_name = models.CharField(max_length=254, unique=True)
corporation_id = models.CharField(max_length=254)
corporation_id = models.PositiveIntegerField()
corporation_name = models.CharField(max_length=254)
corporation_ticker = models.CharField(max_length=5)
alliance_id = models.CharField(max_length=254, blank=True, null=True, default='')
alliance_id = models.PositiveIntegerField(blank=True, null=True, default=None)
alliance_name = models.CharField(max_length=254, blank=True, null=True, default='')
alliance_ticker = models.CharField(max_length=5, blank=True, null=True, default='')
objects = EveCharacterManager()
provider = EveCharacterProviderManager()
class Meta:
indexes = [
models.Index(fields=['corporation_id',]),
models.Index(fields=['alliance_id',]),
models.Index(fields=['corporation_name',]),
models.Index(fields=['alliance_name',]),
]
@property
def alliance(self) -> Union[EveAllianceInfo, None]:
"""
@@ -253,11 +193,13 @@ class EveCharacter(models.Model):
return self.character_name
@staticmethod
def generic_portrait_url(character_id: int, size: int = 32) -> str:
def generic_portrait_url(
character_id: int, size: int = _DEFAULT_IMAGE_SIZE
) -> str:
"""image URL for the given character ID"""
return _eve_entity_image_url('character', character_id, size)
return eveimageserver.character_portrait_url(character_id, size)
def portrait_url(self, size = 32) -> str:
def portrait_url(self, size=_DEFAULT_IMAGE_SIZE) -> str:
"""image URL for this character"""
return self.generic_portrait_url(self.character_id, size)
@@ -281,7 +223,7 @@ class EveCharacter(models.Model):
"""image URL for this character"""
return self.portrait_url(256)
def corporation_logo_url(self, size = 32) -> str:
def corporation_logo_url(self, size=_DEFAULT_IMAGE_SIZE) -> str:
"""image URL for corporation of this character"""
return EveCorporationInfo.generic_logo_url(self.corporation_id, size)
@@ -305,7 +247,7 @@ class EveCharacter(models.Model):
"""image URL for corporation of this character"""
return self.corporation_logo_url(256)
def alliance_logo_url(self, size = 32) -> str:
def alliance_logo_url(self, size=_DEFAULT_IMAGE_SIZE) -> str:
"""image URL for alliance of this character or empty string"""
if self.alliance_id:
return EveAllianceInfo.generic_logo_url(self.alliance_id, size)

File diff suppressed because one or more lines are too long

View File

@@ -5,33 +5,96 @@ from .models import EveAllianceInfo
from .models import EveCharacter
from .models import EveCorporationInfo
from . import providers
logger = logging.getLogger(__name__)
TASK_PRIORITY = 7
CHUNK_SIZE = 500
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
@shared_task
def update_corp(corp_id):
"""Update given corporation from ESI"""
EveCorporationInfo.objects.update_corporation(corp_id)
@shared_task
def update_alliance(alliance_id):
"""Update given alliance from ESI"""
EveAllianceInfo.objects.update_alliance(alliance_id).populate_alliance()
@shared_task
def update_character(character_id):
"""Update given character from ESI"""
EveCharacter.objects.update_character(character_id)
@shared_task
def run_model_update():
"""Update all alliances, corporations and characters from ESI"""
# update existing corp models
for corp in EveCorporationInfo.objects.all().values('corporation_id'):
update_corp.delay(corp['corporation_id'])
update_corp.apply_async(
args=[corp['corporation_id']], priority=TASK_PRIORITY
)
# update existing alliance models
for alliance in EveAllianceInfo.objects.all().values('alliance_id'):
update_alliance.delay(alliance['alliance_id'])
update_alliance.apply_async(
args=[alliance['alliance_id']], priority=TASK_PRIORITY
)
for character in EveCharacter.objects.all().values('character_id'):
update_character.delay(character['character_id'])
# update existing character models
character_ids = EveCharacter.objects.all().values_list('character_id', flat=True)
for character_ids_chunk in chunks(character_ids, CHUNK_SIZE):
affiliations_raw = providers.provider.client.Character\
.post_characters_affiliation(characters=character_ids_chunk).result()
character_names = providers.provider.client.Universe\
.post_universe_names(ids=character_ids_chunk).result()
affiliations = {
affiliation.get('character_id'): affiliation
for affiliation in affiliations_raw
}
# add character names to affiliations
for character in character_names:
character_id = character.get('id')
if character_id in affiliations:
affiliations[character_id]['name'] = character.get('name')
# fetch current characters
characters = EveCharacter.objects.filter(character_id__in=character_ids_chunk)\
.values('character_id', 'corporation_id', 'alliance_id', 'character_name')
for character in characters:
character_id = character.get('character_id')
if character_id in affiliations:
affiliation = affiliations[character_id]
corp_changed = (
character.get('corporation_id') != affiliation.get('corporation_id')
)
alliance_id = character.get('alliance_id')
if not alliance_id:
alliance_id = None
alliance_changed = alliance_id != affiliation.get('alliance_id')
name_changed = False
fetched_name = affiliation.get('name', False)
if fetched_name:
name_changed = character.get('character_name') != fetched_name
if corp_changed or alliance_changed or name_changed:
update_character.apply_async(
args=[character.get('character_id')], priority=TASK_PRIORITY
)

View File

@@ -15,7 +15,7 @@
from django import template
from ..models import EveCharacter, EveCorporationInfo, EveAllianceInfo
from ..evelinks import evewho, dotlan, zkillboard
from ..evelinks import eveimageserver, evewho, dotlan, zkillboard
register = template.Library()
@@ -163,7 +163,7 @@ def dotlan_solar_system_url(eve_obj: object) -> str:
return _generic_evelinks_url(dotlan, 'solar_system_url', eve_obj)
#zkillboard
# zkillboard
@register.filter
def zkillboard_character_url(eve_obj: EveCharacter) -> str:
@@ -212,7 +212,6 @@ def zkillboard_solar_system_url(eve_obj: object) -> str:
# image urls
@register.filter
def character_portrait_url(
eve_obj: object,
@@ -284,3 +283,30 @@ def alliance_logo_url(
except ValueError:
return ''
@register.filter
def type_icon_url(
type_id: int,
size: int = _DEFAULT_IMAGE_SIZE
) -> str:
"""generates a icon image URL for the given type ID
Returns URL or empty string
"""
try:
return eveimageserver.type_icon_url(type_id, size)
except ValueError:
return ''
@register.filter
def type_render_url(
type_id: int,
size: int = _DEFAULT_IMAGE_SIZE
) -> str:
"""generates a render image URL for the given type ID
Returns URL or empty string
"""
try:
return eveimageserver.type_render_url(type_id, size)
except ValueError:
return ''

View File

@@ -12,7 +12,7 @@ class EveCharacterProviderManagerTestCase(TestCase):
expected = Character()
provider.get_character.return_value = expected
result = EveCharacter.provider.get_character('1234')
result = EveCharacter.provider.get_character(1234)
self.assertEqual(expected, result)
@@ -22,30 +22,30 @@ class EveCharacterManagerTestCase(TestCase):
class TestCharacter(Character):
@property
def alliance(self):
return Alliance(id='3456', name='Test Alliance')
return Alliance(id=3456, name='Test Alliance')
@property
def corp(self):
return Corporation(
id='2345',
id=2345,
name='Test Corp',
alliance_id='3456',
ticker='0BUGS'
alliance_id=3456,
ticker='0BUGS' #lies, blatant lies!
)
@mock.patch('allianceauth.eveonline.managers.providers.provider')
def test_create_character(self, provider):
# Also covers create_character_obj
expected = self.TestCharacter(
id='1234',
id=1234,
name='Test Character',
corp_id='2345',
alliance_id='3456'
corp_id=2345,
alliance_id=3456
)
provider.get_character.return_value = expected
result = EveCharacter.objects.create_character('1234')
result = EveCharacter.objects.create_character(1234)
self.assertEqual(result.character_id, expected.id)
self.assertEqual(result.character_name, expected.name)
@@ -59,25 +59,24 @@ class EveCharacterManagerTestCase(TestCase):
def test_update_character(self, provider):
# Also covers Model.update_character
existing = EveCharacter.objects.create(
character_id='1234',
character_id=1234,
character_name='character.name',
corporation_id='character.corp.id',
corporation_id=23457,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
alliance_id='character.alliance.id',
corporation_ticker='cc1',
alliance_id=34567,
alliance_name='character.alliance.name',
)
expected = self.TestCharacter(
id='1234',
id=1234,
name='Test Character',
corp_id='2345',
alliance_id='3456'
corp_id=2345,
alliance_id=3456
)
provider.get_character.return_value = expected
result = EveCharacter.objects.update_character('1234')
result = EveCharacter.objects.update_character(1234)
self.assertEqual(result.character_id, expected.id)
self.assertEqual(result.character_name, expected.name)
@@ -90,23 +89,23 @@ class EveCharacterManagerTestCase(TestCase):
def test_get_character_by_id(self):
EveCharacter.objects.all().delete()
EveCharacter.objects.create(
character_id='1234',
character_id=1234,
character_name='character.name',
corporation_id='character.corp.id',
corporation_id=2345,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
alliance_id='character.alliance.id',
corporation_ticker='cc1',
alliance_id=3456,
alliance_name='character.alliance.name',
)
# try to get existing character
result = EveCharacter.objects.get_character_by_id('1234')
result = EveCharacter.objects.get_character_by_id(1234)
self.assertEqual(result.character_id, '1234')
self.assertEqual(result.character_id, 1234)
self.assertEqual(result.character_name, 'character.name')
# try to get non existing character
self.assertIsNone(EveCharacter.objects.get_character_by_id('9999'))
self.assertIsNone(EveCharacter.objects.get_character_by_id(9999))
class EveAllianceProviderManagerTestCase(TestCase):
@@ -115,7 +114,7 @@ class EveAllianceProviderManagerTestCase(TestCase):
expected = Alliance()
provider.get_alliance.return_value = expected
result = EveAllianceInfo.provider.get_alliance('1234')
result = EveAllianceInfo.provider.get_alliance(1234)
self.assertEqual(expected, result)
@@ -131,16 +130,16 @@ class EveAllianceManagerTestCase(TestCase):
def test_create_alliance(self, provider, populate_alliance):
# Also covers create_alliance_obj
expected = self.TestAlliance(
id='3456',
id=3456,
name='Test Alliance',
ticker='TEST',
corp_ids=['2345'],
executor_corp_id='2345'
corp_ids=[2345],
executor_corp_id=2345
)
provider.get_alliance.return_value = expected
result = EveAllianceInfo.objects.create_alliance('3456')
result = EveAllianceInfo.objects.create_alliance(3456)
self.assertEqual(result.alliance_id, expected.id)
self.assertEqual(result.alliance_name, expected.name)
@@ -152,22 +151,22 @@ class EveAllianceManagerTestCase(TestCase):
def test_update_alliance(self, provider):
# Also covers Model.update_alliance
EveAllianceInfo.objects.create(
alliance_id='3456',
alliance_id=3456,
alliance_name='alliance.name',
alliance_ticker='alliance.ticker',
executor_corp_id='alliance.executor_corp_id',
alliance_ticker='at1',
executor_corp_id=2345,
)
expected = self.TestAlliance(
id='3456',
id=3456,
name='Test Alliance',
ticker='TEST',
corp_ids=['2345'],
executor_corp_id='2345'
corp_ids=[2345],
executor_corp_id=2345
)
provider.get_alliance.return_value = expected
result = EveAllianceInfo.objects.update_alliance('3456')
result = EveAllianceInfo.objects.update_alliance(3456)
# This is the only thing ever updated in code
self.assertEqual(result.executor_corp_id, expected.executor_corp_id)
@@ -179,7 +178,7 @@ class EveCorporationProviderManagerTestCase(TestCase):
expected = Corporation()
provider.get_corp.return_value = expected
result = EveCorporationInfo.provider.get_corporation('2345')
result = EveCorporationInfo.provider.get_corporation(2345)
self.assertEqual(expected, result)
@@ -190,39 +189,39 @@ class EveCorporationManagerTestCase(TestCase):
@property
def alliance(self):
return EveAllianceManagerTestCase.TestAlliance(
id='3456',
id=3456,
name='Test Alliance',
ticker='TEST',
corp_ids=['2345'],
executor_corp_id='2345'
corp_ids=[2345],
executor_corp_id=2345
)
@property
def ceo(self):
return EveCharacterManagerTestCase.TestCharacter(
id='1234',
id=1234,
name='Test Character',
corp_id='2345',
alliance_id='3456'
corp_id=2345,
alliance_id=3456
)
@mock.patch('allianceauth.eveonline.managers.providers.provider')
def test_create_corporation(self, provider):
# Also covers create_corp_obj
exp_alliance = EveAllianceInfo.objects.create(
alliance_id='3456',
alliance_id=3456,
alliance_name='alliance.name',
alliance_ticker='alliance.ticker',
executor_corp_id='alliance.executor_corp_id',
alliance_ticker='99bug',
executor_corp_id=2345,
)
expected = self.TestCorporation(
id='2345',
id=2345,
name='Test Corp',
ticker='0BUGS',
ceo_id='1234',
ceo_id=1234,
members=1,
alliance_id='3456'
alliance_id=3456
)
provider.get_corp.return_value = expected
@@ -240,17 +239,17 @@ class EveCorporationManagerTestCase(TestCase):
# variant to test no alliance case
# Also covers create_corp_obj
expected = self.TestCorporation(
id='2345',
id=2345,
name='Test Corp',
ticker='0BUGS',
ceo_id='1234',
ceo_id=1234,
members=1,
alliance_id='3456'
alliance_id=3456
)
provider.get_corp.return_value = expected
result = EveCorporationInfo.objects.create_corporation('2345')
result = EveCorporationInfo.objects.create_corporation(2345)
self.assertEqual(result.corporation_id, expected.id)
self.assertEqual(result.corporation_name, expected.name)
@@ -262,27 +261,27 @@ class EveCorporationManagerTestCase(TestCase):
def test_update_corporation(self, provider):
# Also covers Model.update_corporation
exp_alliance = EveAllianceInfo.objects.create(
alliance_id='3456',
alliance_id=3456,
alliance_name='alliance.name',
alliance_ticker='alliance.ticker',
executor_corp_id='alliance.executor_corp_id',
alliance_ticker='at1',
executor_corp_id=2345,
)
EveCorporationInfo.objects.create(
corporation_id='2345',
corporation_id=2345,
corporation_name='corp.name',
corporation_ticker='corp.ticker',
corporation_ticker='cc1',
member_count=10,
alliance=None,
)
expected = self.TestCorporation(
id='2345',
id=2345,
name='Test Corp',
ticker='0BUGS',
ceo_id='1234',
ceo_id=1234,
members=1,
alliance_id='3456'
alliance_id=3456
)
provider.get_corp.return_value = expected

View File

@@ -2,130 +2,40 @@ from unittest.mock import Mock, patch
from django.test import TestCase
from ..models import EveCharacter, EveCorporationInfo, \
EveAllianceInfo, _eve_entity_image_url
from ..models import (
EveCharacter, EveCorporationInfo, EveAllianceInfo
)
from ..providers import Alliance, Corporation, Character
from ..evelinks import eveimageserver
class EveUniverseImageUrlTestCase(TestCase):
"""unit test for _eve_entity_image_url()"""
def test_sizes(self):
self.assertEqual(
_eve_entity_image_url('character', 42),
'https://images.evetech.net/characters/42/portrait?size=32'
)
self.assertEqual(
_eve_entity_image_url('character', 42, size=32),
'https://images.evetech.net/characters/42/portrait?size=32'
)
self.assertEqual(
_eve_entity_image_url('character', 42, size=64),
'https://images.evetech.net/characters/42/portrait?size=64'
)
self.assertEqual(
_eve_entity_image_url('character', 42, size=128),
'https://images.evetech.net/characters/42/portrait?size=128'
)
self.assertEqual(
_eve_entity_image_url('character', 42, size=256),
'https://images.evetech.net/characters/42/portrait?size=256'
)
self.assertEqual(
_eve_entity_image_url('character', 42, size=512),
'https://images.evetech.net/characters/42/portrait?size=512'
)
self.assertEqual(
_eve_entity_image_url('character', 42, size=1024),
'https://images.evetech.net/characters/42/portrait?size=1024'
)
with self.assertRaises(ValueError):
_eve_entity_image_url('corporation', 42, size=-5)
with self.assertRaises(ValueError):
_eve_entity_image_url('corporation', 42, size=0)
with self.assertRaises(ValueError):
_eve_entity_image_url('corporation', 42, size=31)
with self.assertRaises(ValueError):
_eve_entity_image_url('corporation', 42, size=1025)
with self.assertRaises(ValueError):
_eve_entity_image_url('corporation', 42, size=2048)
def test_variant(self):
self.assertEqual(
_eve_entity_image_url('character', 42, variant='portrait'),
'https://images.evetech.net/characters/42/portrait?size=32'
)
self.assertEqual(
_eve_entity_image_url('alliance', 42, variant='logo'),
'https://images.evetech.net/alliances/42/logo?size=32'
)
with self.assertRaises(ValueError):
_eve_entity_image_url('character', 42, variant='logo')
def test_alliance(self):
self.assertEqual(
_eve_entity_image_url('alliance', 42),
'https://images.evetech.net/alliances/42/logo?size=32'
)
self.assertEqual(
_eve_entity_image_url('corporation', 42),
'https://images.evetech.net/corporations/42/logo?size=32'
)
self.assertEqual(
_eve_entity_image_url('character', 42),
'https://images.evetech.net/characters/42/portrait?size=32'
)
with self.assertRaises(ValueError):
_eve_entity_image_url('station', 42)
def test_tenants(self):
self.assertEqual(
_eve_entity_image_url('character', 42, tenant='tranquility'),
'https://images.evetech.net/characters/42/portrait?size=32&tenant=tranquility'
)
self.assertEqual(
_eve_entity_image_url('character', 42, tenant='singularity'),
'https://images.evetech.net/characters/42/portrait?size=32&tenant=singularity'
)
with self.assertRaises(ValueError):
_eve_entity_image_url('character', 42, tenant='xxx')
class EveCharacterTestCase(TestCase):
def test_corporation_prop(self):
"""
Test that the correct corporation is returned by the corporation property
"""
character = EveCharacter.objects.create(
character_id='1234',
character_id=1234,
character_name='character.name',
corporation_id='2345',
corporation_id=2345,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
alliance_id='character.alliance.id',
corporation_ticker='cc1',
alliance_id=12345,
alliance_name='character.alliance.name',
)
expected = EveCorporationInfo.objects.create(
corporation_id='2345',
corporation_id=2345,
corporation_name='corp.name',
corporation_ticker='corp.ticker',
corporation_ticker='cc1',
member_count=10,
alliance=None,
)
incorrect = EveCorporationInfo.objects.create(
corporation_id='9999',
corporation_id=9999,
corporation_name='corp.name1',
corporation_ticker='corp.ticker1',
corporation_ticker='cc11',
member_count=10,
alliance=None,
)
@@ -139,44 +49,44 @@ class EveCharacterTestCase(TestCase):
object is not in the database
"""
character = EveCharacter.objects.create(
character_id='1234',
character_id=1234,
character_name='character.name',
corporation_id='2345',
corporation_id=2345,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
alliance_id='character.alliance.id',
corporation_ticker='cc1',
alliance_id=123456,
alliance_name='character.alliance.name',
)
with self.assertRaises(EveCorporationInfo.DoesNotExist):
result = character.corporation
character.corporation
def test_alliance_prop(self):
"""
Test that the correct alliance is returned by the alliance property
"""
character = EveCharacter.objects.create(
character_id='1234',
character_id=1234,
character_name='character.name',
corporation_id='2345',
corporation_id=2345,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
alliance_id='3456',
corporation_ticker='cc1',
alliance_id=3456,
alliance_name='character.alliance.name',
)
expected = EveAllianceInfo.objects.create(
alliance_id='3456',
alliance_id=3456,
alliance_name='alliance.name',
alliance_ticker='alliance.ticker',
executor_corp_id='alliance.executor_corp_id',
alliance_ticker='ac2',
executor_corp_id=2345,
)
incorrect = EveAllianceInfo.objects.create(
alliance_id='9001',
alliance_id=9001,
alliance_name='alliance.name1',
alliance_ticker='alliance.ticker1',
executor_corp_id='alliance.executor_corp_id1',
alliance_ticker='ac1',
executor_corp_id=2654,
)
self.assertEqual(character.alliance, expected)
@@ -188,28 +98,28 @@ class EveCharacterTestCase(TestCase):
object is not in the database
"""
character = EveCharacter.objects.create(
character_id='1234',
character_id=1234,
character_name='character.name',
corporation_id='2345',
corporation_id=2345,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
alliance_id='3456',
corporation_ticker='cc1',
alliance_id=3456,
alliance_name='character.alliance.name',
)
with self.assertRaises(EveAllianceInfo.DoesNotExist):
result = character.alliance
character.alliance
def test_alliance_prop_none(self):
"""
Check that None is returned when the character has no alliance
"""
character = EveCharacter.objects.create(
character_id='1234',
character_id=1234,
character_name='character.name',
corporation_id='2345',
corporation_id=2345,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
corporation_ticker='cc1',
alliance_id=None,
alliance_name=None,
)
@@ -227,12 +137,12 @@ class EveCharacterTestCase(TestCase):
)
my_character = EveCharacter.objects.create(
character_id='1001',
character_id=1001,
character_name='Bruce Wayne',
corporation_id='2001',
corporation_id=2001,
corporation_name='Dummy Corp 1',
corporation_ticker='DC1',
alliance_id='3001',
alliance_id=3001,
alliance_name='Dummy Alliance 1',
)
my_updated_character = Character(
@@ -244,90 +154,87 @@ class EveCharacterTestCase(TestCase):
# todo: add test cases not yet covered, e.g. with alliance
def test_image_url(self):
self.assertEqual(
EveCharacter.generic_portrait_url(42),
_eve_entity_image_url('character', 42)
eveimageserver._eve_entity_image_url('character', 42)
)
self.assertEqual(
EveCharacter.generic_portrait_url(42, 256),
_eve_entity_image_url('character', 42, 256)
eveimageserver._eve_entity_image_url('character', 42, 256)
)
def test_portrait_urls(self):
x = EveCharacter(
character_id='42',
character_id=42,
character_name='character.name',
corporation_id='123',
corporation_id=123,
corporation_name='corporation.name',
corporation_ticker='ABC',
)
self.assertEqual(
x.portrait_url(),
_eve_entity_image_url('character', 42)
eveimageserver._eve_entity_image_url('character', 42)
)
self.assertEqual(
x.portrait_url(64),
_eve_entity_image_url('character', 42, size=64)
eveimageserver._eve_entity_image_url('character', 42, size=64)
)
self.assertEqual(
x.portrait_url_32,
_eve_entity_image_url('character', 42, size=32)
eveimageserver._eve_entity_image_url('character', 42, size=32)
)
self.assertEqual(
x.portrait_url_64,
_eve_entity_image_url('character', 42, size=64)
eveimageserver._eve_entity_image_url('character', 42, size=64)
)
self.assertEqual(
x.portrait_url_128,
_eve_entity_image_url('character', 42, size=128)
eveimageserver._eve_entity_image_url('character', 42, size=128)
)
self.assertEqual(
x.portrait_url_256,
_eve_entity_image_url('character', 42, size=256)
eveimageserver._eve_entity_image_url('character', 42, size=256)
)
def test_corporation_logo_urls(self):
x = EveCharacter(
character_id='42',
character_id=42,
character_name='character.name',
corporation_id='123',
corporation_id=123,
corporation_name='corporation.name',
corporation_ticker='ABC',
)
self.assertEqual(
x.corporation_logo_url(),
_eve_entity_image_url('corporation', 123)
eveimageserver._eve_entity_image_url('corporation', 123)
)
self.assertEqual(
x.corporation_logo_url(256),
_eve_entity_image_url('corporation', 123, size=256)
eveimageserver._eve_entity_image_url('corporation', 123, size=256)
)
self.assertEqual(
x.corporation_logo_url_32,
_eve_entity_image_url('corporation', 123, size=32)
eveimageserver._eve_entity_image_url('corporation', 123, size=32)
)
self.assertEqual(
x.corporation_logo_url_64,
_eve_entity_image_url('corporation', 123, size=64)
eveimageserver._eve_entity_image_url('corporation', 123, size=64)
)
self.assertEqual(
x.corporation_logo_url_128,
_eve_entity_image_url('corporation', 123, size=128)
eveimageserver._eve_entity_image_url('corporation', 123, size=128)
)
self.assertEqual(
x.corporation_logo_url_256,
_eve_entity_image_url('corporation', 123, size=256)
eveimageserver._eve_entity_image_url('corporation', 123, size=256)
)
def test_alliance_logo_urls(self):
x = EveCharacter(
character_id='42',
character_id=42,
character_name='character.name',
corporation_id='123',
corporation_id=123,
corporation_name='corporation.name',
corporation_ticker='ABC',
)
@@ -354,27 +261,27 @@ class EveCharacterTestCase(TestCase):
x.alliance_id = 987
self.assertEqual(
x.alliance_logo_url(),
_eve_entity_image_url('alliance', 987)
eveimageserver._eve_entity_image_url('alliance', 987)
)
self.assertEqual(
x.alliance_logo_url(128),
_eve_entity_image_url('alliance', 987, size=128)
eveimageserver._eve_entity_image_url('alliance', 987, size=128)
)
self.assertEqual(
x.alliance_logo_url_32,
_eve_entity_image_url('alliance', 987, size=32)
eveimageserver._eve_entity_image_url('alliance', 987, size=32)
)
self.assertEqual(
x.alliance_logo_url_64,
_eve_entity_image_url('alliance', 987, size=64)
eveimageserver._eve_entity_image_url('alliance', 987, size=64)
)
self.assertEqual(
x.alliance_logo_url_128,
_eve_entity_image_url('alliance', 987, size=128)
eveimageserver._eve_entity_image_url('alliance', 987, size=128)
)
self.assertEqual(
x.alliance_logo_url_256,
_eve_entity_image_url('alliance', 987, size=256)
eveimageserver._eve_entity_image_url('alliance', 987, size=256)
)
@@ -456,7 +363,6 @@ class EveAllianceTestCase(TestCase):
# potential bug
# update_alliance() is only updateting executor_corp_id when object is given
def test_update_alliance_wo_object(self):
mock_EveAllianceProviderManager = Mock()
mock_EveAllianceProviderManager.get_alliance.return_value = \
@@ -475,11 +381,11 @@ class EveAllianceTestCase(TestCase):
)
my_alliance.provider = mock_EveAllianceProviderManager
my_alliance.save()
updated_alliance = Alliance(
name='Dummy Alliance 2',
corp_ids=[2004],
executor_corp_id=2004
)
Alliance(
name='Dummy Alliance 2',
corp_ids=[2004],
executor_corp_id=2004
)
my_alliance.update_alliance()
my_alliance.refresh_from_db()
self.assertEqual(int(my_alliance.executor_corp_id), 2004)
@@ -487,23 +393,22 @@ class EveAllianceTestCase(TestCase):
# potential bug
# update_alliance() is only updateting executor_corp_id nothing else ???
def test_image_url(self):
self.assertEqual(
EveAllianceInfo.generic_logo_url(42),
_eve_entity_image_url('alliance', 42)
eveimageserver._eve_entity_image_url('alliance', 42)
)
self.assertEqual(
EveAllianceInfo.generic_logo_url(42, 256),
_eve_entity_image_url('alliance', 42, 256)
eveimageserver._eve_entity_image_url('alliance', 42, 256)
)
def test_logo_url(self):
x = EveAllianceInfo(
alliance_id='42',
alliance_id=42,
alliance_name='alliance.name',
alliance_ticker='ABC',
executor_corp_id='123'
executor_corp_id=123
)
self.assertEqual(
x.logo_url(),
@@ -563,9 +468,7 @@ class EveCorporationTestCase(TestCase):
def test_update_corporation_no_object_w_alliance(self):
mock_provider = Mock()
mock_provider.get_corporation.return_value = Corporation(
members=87
)
mock_provider.get_corporation.return_value = Corporation(members=87)
self.my_corp.provider = mock_provider
self.my_corp.update_corporation()
@@ -585,15 +488,14 @@ class EveCorporationTestCase(TestCase):
self.assertEqual(my_corp2.member_count, 8)
self.assertIsNone(my_corp2.alliance)
def test_image_url(self):
self.assertEqual(
EveCorporationInfo.generic_logo_url(42),
_eve_entity_image_url('corporation', 42)
eveimageserver._eve_entity_image_url('corporation', 42)
)
self.assertEqual(
EveCorporationInfo.generic_logo_url(42, 256),
_eve_entity_image_url('corporation', 42, 256)
eveimageserver._eve_entity_image_url('corporation', 42, 256)
)
def test_logo_url(self):
@@ -621,4 +523,3 @@ class EveCorporationTestCase(TestCase):
self.my_corp.logo_url_256,
'https://images.evetech.net/corporations/2001/logo?size=256'
)

View File

@@ -1,21 +1,28 @@
import os
from unittest.mock import Mock, patch
from bravado.exception import HTTPNotFound, HTTPUnprocessableEntity
from bravado.exception import HTTPNotFound
from jsonschema.exceptions import RefResolutionError
from django.test import TestCase
from . import set_logger
from ..models import EveCharacter, EveCorporationInfo, EveAllianceInfo
from ..providers import ObjectNotFound, Entity, Character, Corporation, \
Alliance, ItemType, EveProvider, EveSwaggerProvider
from ..providers import (
ObjectNotFound,
Entity,
Character,
Corporation,
Alliance,
ItemType,
EveProvider,
EveSwaggerProvider
)
MODULE_PATH = 'allianceauth.eveonline.providers'
SWAGGER_OLD_SPEC_PATH = os.path.join(os.path.dirname(
os.path.abspath(__file__)), 'swagger_old.json'
)
os.path.abspath(__file__)), 'swagger_old.json'
)
set_logger(MODULE_PATH, __file__)
@@ -51,7 +58,6 @@ class TestEntity(TestCase):
x = Entity()
self.assertEqual(repr(x), '<Entity (None): None>')
def test_bool(self):
x = Entity(1001)
self.assertTrue(bool(x))
@@ -99,7 +105,6 @@ class TestCorporation(TestCase):
# should fetch alliance once only
self.assertEqual(mock_provider_get_alliance.call_count, 1)
@patch(MODULE_PATH + '.EveSwaggerProvider.get_alliance')
def test_alliance_not_defined(self, mock_provider_get_alliance):
mock_provider_get_alliance.return_value = None
@@ -110,7 +115,6 @@ class TestCorporation(TestCase):
Entity(None, None)
)
@patch(MODULE_PATH + '.EveSwaggerProvider.get_character')
def test_ceo(self, mock_provider_get_character):
my_ceo = Character(
@@ -200,7 +204,6 @@ class TestAlliance(TestCase):
# should be called once by used corp only
self.assertEqual(mock_provider_get_corp.call_count, 2)
@patch(MODULE_PATH + '.EveSwaggerProvider.get_corp')
def test_corps(self, mock_provider_get_corp):
mock_provider_get_corp.side_effect = TestAlliance._get_corp
@@ -253,7 +256,6 @@ class TestCharacter(TestCase):
# should call the provider one time only
self.assertEqual(mock_provider_get_corp.call_count, 1)
@patch(MODULE_PATH + '.EveSwaggerProvider.get_alliance')
@patch(MODULE_PATH + '.EveSwaggerProvider.get_corp')
@@ -283,7 +285,6 @@ class TestCharacter(TestCase):
self.assertEqual(mock_provider_get_corp.call_count, 1)
self.assertEqual(mock_provider_get_alliance.call_count, 1)
def test_alliance_has_none(self):
self.my_character.alliance_id = None
self.assertEqual(self.my_character.alliance, Entity(None, None))
@@ -343,7 +344,6 @@ class TestEveSwaggerProvider(TestCase):
else:
raise HTTPNotFound(Mock())
@staticmethod
def esi_get_alliances_alliance_id_corporations(alliance_id):
alliances = {
@@ -357,7 +357,6 @@ class TestEveSwaggerProvider(TestCase):
else:
raise HTTPNotFound(Mock())
@staticmethod
def esi_get_corporations_corporation_id(corporation_id):
corporations = {
@@ -382,7 +381,6 @@ class TestEveSwaggerProvider(TestCase):
else:
raise HTTPNotFound(Mock())
@staticmethod
def esi_get_characters_character_id(character_id):
characters = {
@@ -403,7 +401,6 @@ class TestEveSwaggerProvider(TestCase):
else:
raise HTTPNotFound(Mock())
@staticmethod
def esi_post_characters_affiliation(characters):
character_data = {
@@ -428,7 +425,6 @@ class TestEveSwaggerProvider(TestCase):
else:
raise TypeError()
@staticmethod
def esi_get_universe_types_type_id(type_id):
types = {
@@ -446,13 +442,11 @@ class TestEveSwaggerProvider(TestCase):
else:
raise HTTPNotFound(Mock())
@patch(MODULE_PATH + '.esi_client_factory')
def test_str(self, mock_esi_client_factory):
my_provider = EveSwaggerProvider()
self.assertEqual(str(my_provider), 'esi')
@patch(MODULE_PATH + '.esi_client_factory')
def test_get_alliance(self, mock_esi_client_factory):
mock_esi_client_factory.return_value\
@@ -481,7 +475,6 @@ class TestEveSwaggerProvider(TestCase):
with self.assertRaises(ObjectNotFound):
my_provider.get_alliance(3999)
@patch(MODULE_PATH + '.esi_client_factory')
def test_get_corp(self, mock_esi_client_factory):
mock_esi_client_factory.return_value\
@@ -508,7 +501,6 @@ class TestEveSwaggerProvider(TestCase):
with self.assertRaises(ObjectNotFound):
my_provider.get_corp(2999)
@patch(MODULE_PATH + '.esi_client_factory')
def test_get_character(self, mock_esi_client_factory):
mock_esi_client_factory.return_value\
@@ -536,7 +528,6 @@ class TestEveSwaggerProvider(TestCase):
with self.assertRaises(ObjectNotFound):
my_provider.get_character(1999)
@patch(MODULE_PATH + '.esi_client_factory')
def test_get_itemtype(self, mock_esi_client_factory):
mock_esi_client_factory.return_value\
@@ -601,5 +592,3 @@ class TestEveSwaggerProvider(TestCase):
self.assertTrue(mock_esi_client_factory.called)
self.assertIsNotNone(my_provider._client)
self.assertEqual(my_client, 'my_client')

View File

@@ -3,8 +3,12 @@ from unittest.mock import patch, Mock
from django.test import TestCase
from ..models import EveCharacter, EveCorporationInfo, EveAllianceInfo
from ..tasks import update_alliance, update_corp, update_character, \
from ..tasks import (
update_alliance,
update_corp,
update_character,
run_model_update
)
class TestTasks(TestCase):
@@ -13,98 +17,229 @@ class TestTasks(TestCase):
def test_update_corp(self, mock_EveCorporationInfo):
update_corp(42)
self.assertEqual(
mock_EveCorporationInfo.objects.update_corporation.call_count,
1
mock_EveCorporationInfo.objects.update_corporation.call_count, 1
)
self.assertEqual(
mock_EveCorporationInfo.objects.update_corporation.call_args[0][0],
42
mock_EveCorporationInfo.objects.update_corporation.call_args[0][0], 42
)
@patch('allianceauth.eveonline.tasks.EveAllianceInfo')
def test_update_alliance(self, mock_EveAllianceInfo):
update_alliance(42)
self.assertEqual(
mock_EveAllianceInfo.objects.update_alliance.call_args[0][0],
42
mock_EveAllianceInfo.objects.update_alliance.call_args[0][0], 42
)
self.assertEqual(
mock_EveAllianceInfo.objects\
.update_alliance.return_value.populate_alliance.call_count,
1
mock_EveAllianceInfo.objects
.update_alliance.return_value.populate_alliance.call_count, 1
)
@patch('allianceauth.eveonline.tasks.EveCharacter')
def test_update_character(self, mock_EveCharacter):
update_character(42)
self.assertEqual(
mock_EveCharacter.objects.update_character.call_count,
1
mock_EveCharacter.objects.update_character.call_count, 1
)
self.assertEqual(
mock_EveCharacter.objects.update_character.call_args[0][0],
42
mock_EveCharacter.objects.update_character.call_args[0][0], 42
)
@patch('allianceauth.eveonline.tasks.update_character')
@patch('allianceauth.eveonline.tasks.update_alliance')
@patch('allianceauth.eveonline.tasks.update_corp')
def test_run_model_update(
self,
mock_update_corp,
mock_update_alliance,
mock_update_character,
):
@patch('allianceauth.eveonline.tasks.update_character')
@patch('allianceauth.eveonline.tasks.update_alliance')
@patch('allianceauth.eveonline.tasks.update_corp')
@patch('allianceauth.eveonline.providers.provider')
@patch('allianceauth.eveonline.tasks.CHUNK_SIZE', 2)
class TestRunModelUpdate(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
EveCorporationInfo.objects.all().delete()
EveAllianceInfo.objects.all().delete()
EveCharacter.objects.all().delete()
EveCorporationInfo.objects.create(
corporation_id='2345',
corporation_id=2345,
corporation_name='corp.name',
corporation_ticker='corp.ticker',
corporation_ticker='c.c.t',
member_count=10,
alliance=None,
)
EveAllianceInfo.objects.create(
alliance_id='3456',
alliance_id=3456,
alliance_name='alliance.name',
alliance_ticker='alliance.ticker',
executor_corp_id='alliance.executor_corp_id',
alliance_ticker='a.t',
executor_corp_id=5,
)
EveCharacter.objects.create(
character_id=1,
character_name='character.name1',
corporation_id=2345,
corporation_name='character.corp.name',
corporation_ticker='c.c.t', # max 5 chars
alliance_id=None
)
EveCharacter.objects.create(
character_id='1234',
character_name='character.name',
corporation_id='character.corp.id',
character_id=2,
character_name='character.name2',
corporation_id=9876,
corporation_name='character.corp.name',
corporation_ticker='character.corp.ticker',
alliance_id='character.alliance.id',
corporation_ticker='c.c.t', # max 5 chars
alliance_id=3456,
alliance_name='character.alliance.name',
)
EveCharacter.objects.create(
character_id=3,
character_name='character.name3',
corporation_id=9876,
corporation_name='character.corp.name',
corporation_ticker='c.c.t', # max 5 chars
alliance_id=3456,
alliance_name='character.alliance.name',
)
EveCharacter.objects.create(
character_id=4,
character_name='character.name4',
corporation_id=9876,
corporation_name='character.corp.name',
corporation_ticker='c.c.t', # max 5 chars
alliance_id=3456,
alliance_name='character.alliance.name',
)
"""
EveCharacter.objects.create(
character_id=5,
character_name='character.name5',
corporation_id=9876,
corporation_name='character.corp.name',
corporation_ticker='c.c.t', # max 5 chars
alliance_id=3456,
alliance_name='character.alliance.name',
)
"""
def setUp(self):
self.affiliations = [
{'character_id': 1, 'corporation_id': 5},
{'character_id': 2, 'corporation_id': 9876, 'alliance_id': 3456},
{'character_id': 3, 'corporation_id': 9876, 'alliance_id': 7456},
{'character_id': 4, 'corporation_id': 9876, 'alliance_id': 3456}
]
self.names = [
{'id': 1, 'name': 'character.name1'},
{'id': 2, 'name': 'character.name2'},
{'id': 3, 'name': 'character.name3'},
{'id': 4, 'name': 'character.name4_new'}
]
def test_normal_run(
self,
mock_provider,
mock_update_corp,
mock_update_alliance,
mock_update_character,
):
def get_affiliations(characters: list):
response = [x for x in self.affiliations if x['character_id'] in characters]
mock_operator = Mock(**{'result.return_value': response})
return mock_operator
def get_names(ids: list):
response = [x for x in self.names if x['id'] in ids]
mock_operator = Mock(**{'result.return_value': response})
return mock_operator
mock_provider.client.Character.post_characters_affiliation.side_effect \
= get_affiliations
mock_provider.client.Universe.post_universe_names.side_effect = get_names
run_model_update()
self.assertEqual(mock_update_corp.delay.call_count, 1)
self.assertEqual(
int(mock_update_corp.delay.call_args[0][0]),
2345
)
self.assertEqual(mock_update_alliance.delay.call_count, 1)
self.assertEqual(
int(mock_update_alliance.delay.call_args[0][0]),
3456
mock_provider.client.Character.post_characters_affiliation.call_count, 2
)
self.assertEqual(
mock_provider.client.Universe.post_universe_names.call_count, 2
)
# character 1 has changed corp
# character 2 no change
# character 3 has changed alliance
# character 4 has changed name
self.assertEqual(mock_update_corp.apply_async.call_count, 1)
self.assertEqual(
int(mock_update_corp.apply_async.call_args[1]['args'][0]), 2345
)
self.assertEqual(mock_update_alliance.apply_async.call_count, 1)
self.assertEqual(
int(mock_update_alliance.apply_async.call_args[1]['args'][0]), 3456
)
characters_updated = {
x[1]['args'][0] for x in mock_update_character.apply_async.call_args_list
}
excepted = {1, 3, 4}
self.assertSetEqual(characters_updated, excepted)
def test_ignore_character_not_in_affiliations(
self,
mock_provider,
mock_update_corp,
mock_update_alliance,
mock_update_character,
):
def get_affiliations(characters: list):
response = [x for x in self.affiliations if x['character_id'] in characters]
mock_operator = Mock(**{'result.return_value': response})
return mock_operator
def get_names(ids: list):
response = [x for x in self.names if x['id'] in ids]
mock_operator = Mock(**{'result.return_value': response})
return mock_operator
del self.affiliations[0]
mock_provider.client.Character.post_characters_affiliation.side_effect \
= get_affiliations
mock_provider.client.Universe.post_universe_names.side_effect = get_names
self.assertEqual(mock_update_character.delay.call_count, 1)
self.assertEqual(
int(mock_update_character.delay.call_args[0][0]),
1234
)
run_model_update()
characters_updated = {
x[1]['args'][0] for x in mock_update_character.apply_async.call_args_list
}
excepted = {3, 4}
self.assertSetEqual(characters_updated, excepted)
def test_ignore_character_not_in_names(
self,
mock_provider,
mock_update_corp,
mock_update_alliance,
mock_update_character,
):
def get_affiliations(characters: list):
response = [x for x in self.affiliations if x['character_id'] in characters]
mock_operator = Mock(**{'result.return_value': response})
return mock_operator
def get_names(ids: list):
response = [x for x in self.names if x['id'] in ids]
mock_operator = Mock(**{'result.return_value': response})
return mock_operator
del self.names[3]
mock_provider.client.Character.post_characters_affiliation.side_effect \
= get_affiliations
mock_provider.client.Universe.post_universe_names.side_effect = get_names
run_model_update()
characters_updated = {
x[1]['args'][0] for x in mock_update_character.apply_async.call_args_list
}
excepted = {1, 3}
self.assertSetEqual(characters_updated, excepted)

View File

@@ -6,7 +6,7 @@ from allianceauth.services.hooks import MenuItemHook, UrlHook
@hooks.register('menu_item_hook')
def register_menu():
return MenuItemHook(_('Fleet Activity Tracking'), 'fa fa-users fa-lightbulb-o fa-fw', 'fatlink:view',
return MenuItemHook(_('Fleet Activity Tracking'), 'fas fa-users fa-fw', 'fatlink:view',
navactive=['fatlink:'])

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Create Fatlink" %}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Fatlink view" %}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Personal fatlink statistics" %}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Personal fatlink statistics" %}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Fatlink Corp Statistics" %}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Fatlink statistics" %}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Fatlink view" %}{% endblock page_title %}

View File

@@ -41,7 +41,7 @@ class AuthGroupInlineAdmin(admin.StackedInline):
kwargs["queryset"] = Group.objects.order_by(Lower('name'))
return super().formfield_for_manytomany(db_field, request, **kwargs)
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):

View File

@@ -0,0 +1,38 @@
from django.utils.translation import ugettext_lazy as _
from allianceauth.services.hooks import MenuItemHook, UrlHook
from allianceauth import hooks
from . import urls
from .managers import GroupManager
class GroupManagementMenuItem(MenuItemHook):
""" This class ensures only authorized users will see the menu entry """
def __init__(self):
# setup menu entry for sidebar
MenuItemHook.__init__(
self,
text=_('Group Management'),
classes='fas fa-users-cog fa-fw',
url_name='groupmanagement:management',
order=50,
navactive=['groupmanagement:management']
)
def render(self, request):
if GroupManager.can_manage_groups(request.user):
app_count = GroupManager.pending_requests_count_for_user(request.user)
self.count = app_count if app_count and app_count > 0 else None
return MenuItemHook.render(self, request)
return ''
@hooks.register('menu_item_hook')
def register_menu():
return GroupManagementMenuItem()
@hooks.register('url_hook')
def register_urls():
return UrlHook(urls, 'group', r'^group/')

View File

@@ -1,5 +0,0 @@
from allianceauth.groupmanagement.managers import GroupManager
def can_manage_groups(request):
return {'can_manage_groups': GroupManager.can_manage_groups(request.user)}

View File

@@ -1,27 +1,54 @@
from django.contrib.auth.models import Group
from django.db.models import Q
import logging
from django.contrib.auth.models import Group, User
from django.db.models import Q, QuerySet
from allianceauth.authentication.models import State
from .models import GroupRequest
logger = logging.getLogger(__name__)
class GroupManager:
def __init__(self):
pass
@classmethod
def get_joinable_groups_for_user(
cls, user: User, include_hidden = True
) -> QuerySet:
"""get groups a user could join incl. groups already joined"""
groups_qs = cls.get_joinable_groups(user.profile.state)
if not user.has_perm('groupmanagement.request_groups'):
groups_qs = groups_qs.filter(authgroup__public=True)
if not include_hidden:
groups_qs = groups_qs.filter(authgroup__hidden=False)
return groups_qs
@staticmethod
def get_joinable_groups(state):
return Group.objects.select_related('authgroup').exclude(authgroup__internal=True)\
def get_joinable_groups(state: State) -> QuerySet:
"""get groups that can be joined by user with given state"""
return Group.objects\
.select_related('authgroup')\
.exclude(authgroup__internal=True)\
.filter(Q(authgroup__states=state) | Q(authgroup__states=None))
@staticmethod
def get_all_non_internal_groups():
return Group.objects.select_related('authgroup').exclude(authgroup__internal=True)
def get_all_non_internal_groups() -> QuerySet:
"""get groups that are not internal"""
return Group.objects\
.select_related('authgroup')\
.exclude(authgroup__internal=True)
@staticmethod
def get_group_leaders_groups(user):
def get_group_leaders_groups(user: User):
return Group.objects.select_related('authgroup').filter(authgroup__group_leaders__in=[user]) | \
Group.objects.select_related('authgroup').filter(authgroup__group_leader_groups__in=user.groups.all())
@staticmethod
def joinable_group(group, state):
def joinable_group(group: Group, state: State) -> bool:
"""
Check if a group is a user/state joinable group, i.e.
not an internal group for Corp, Alliance, Members etc,
@@ -30,12 +57,15 @@ class GroupManager:
:param state: allianceauth.authentication.State object
:return: bool True if its joinable, False otherwise
"""
if len(group.authgroup.states.all()) != 0 and state not in group.authgroup.states.all():
if (len(group.authgroup.states.all()) != 0
and state not in group.authgroup.states.all()
):
return False
return not group.authgroup.internal
else:
return not group.authgroup.internal
@staticmethod
def check_internal_group(group):
def check_internal_group(group: Group) -> bool:
"""
Check if a group is auditable, i.e not an internal group
:param group: django.contrib.auth.models.Group object
@@ -44,20 +74,11 @@ class GroupManager:
return not group.authgroup.internal
@staticmethod
def check_internal_group(group):
"""
Check if a group is auditable, i.e not an internal group
:param group: django.contrib.auth.models.Group object
:return: bool True if it is auditable, false otherwise
"""
return not group.authgroup.internal
@staticmethod
def has_management_permission(user):
def has_management_permission(user: User) -> bool:
return user.has_perm('auth.group_management')
@classmethod
def can_manage_groups(cls, user):
def can_manage_groups(cls, user:User ) -> bool:
"""
For use with user_passes_test decorator.
Check if the user can manage groups. Either has the
@@ -71,7 +92,7 @@ class GroupManager:
return False
@classmethod
def can_manage_group(cls, user, group):
def can_manage_group(cls, user: User, group: Group) -> bool:
"""
Check user has permission to manage the given group
:param user: User object to test permission of
@@ -81,3 +102,18 @@ class GroupManager:
if user.is_authenticated:
return cls.has_management_permission(user) or cls.get_group_leaders_groups(user).filter(pk=group.pk).exists()
return False
@classmethod
def pending_requests_count_for_user(cls, user: User) -> int:
"""Returns the number of pending group requests for the given user"""
if cls.has_management_permission(user):
return GroupRequest.objects.filter(status="pending").count()
else:
return (
GroupRequest.objects
.filter(status="pending")
.filter(group__authgroup__group_leaders__exact=user)
.select_related("group__authgroup__group_leaders")
.count()
)

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.1.1 on 2020-09-18 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('groupmanagement', '0013_fix_requestlog_date_field'),
]
operations = [
migrations.AlterField(
model_name='requestlog',
name='request_type',
field=models.BooleanField(null=True),
),
]

View File

@@ -4,7 +4,6 @@ from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from allianceauth.authentication.models import State
from datetime import datetime
class GroupRequest(models.Model):
@@ -26,7 +25,7 @@ class GroupRequest(models.Model):
class RequestLog(models.Model):
request_type = models.NullBooleanField(default=0)
request_type = models.BooleanField(null=True)
group = models.ForeignKey(Group, on_delete=models.CASCADE)
request_info = models.CharField(max_length=254)
action = models.BooleanField(default=0)

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{{ group }} {% trans "Audit Log" %}{% endblock page_title %}
@@ -15,7 +15,7 @@
<div class="panel-body">
<p>
<a class="btn btn-default" href="{% url 'groupmanagement:membership' %}" role="button">
Back
{% trans "Back" %}
</a>
</p>
{% if entries %}
@@ -33,7 +33,7 @@
<tbody>
{% for entry in entries %}
<tr>
<td class="text-center">{{ entry.date }}</td>
<td class="text-center">{{ entry.date|date:"Y-M-d, H:i" }}</td>
<td class="text-center">{{ entry.requestor }}</td>
<td class="text-center">{{ entry.req_char }}</td>
<td class="text-center">{{ entry.req_char.corporation_name }}</td>
@@ -66,7 +66,8 @@
{% block extra_javascript %}
{% include 'bundles/datatables-js.html' %}
<script type="text/javascript" src="{% static 'js/filterDropDown/filterDropDown.min.js' %}"></script>
{% include 'bundles/moment-js.html' with locale=True %}
<script type="application/javascript" src="{% static 'js/filterDropDown/filterDropDown.min.js' %}"></script>
{% endblock %}
{% block extra_css %}
@@ -74,7 +75,26 @@
{% endblock %}
{% block extra_script %}
$.fn.dataTable.moment = function ( format, locale ) {
var types = $.fn.dataTable.ext.type;
// Add type detection
types.detect.unshift( function ( d ) {
return moment( d, format, locale, true ).isValid() ?
'moment-'+format :
null;
} );
// Add sorting method - use an integer for the sorting
types.order[ 'moment-'+format+'-pre' ] = function ( d ) {
return moment( d, format, locale, true ).unix();
};
};
$(document).ready(function(){
$.fn.dataTable.moment( 'YYYY-MMM-D, HH:mm' );
$('#log-entries').DataTable({
order: [[ 0, 'desc' ], [ 1, 'asc' ] ],
filterDropDown:

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% load evelinks %}
@@ -17,7 +17,7 @@
<div class="panel-body">
<p>
<a class="btn btn-default" href="{% url 'groupmanagement:membership' %}" role="button">
Back
{% trans "Back" %}
</a>
</p>
{% if group.user_set %}
@@ -36,7 +36,7 @@
<tr>
<td class="text-right">
{% if member.is_leader %}
<i class="fa fa-star"></i>&nbsp;
<i class="fas fa-star"></i>&nbsp;
{% endif %}
<img src="{{ member.main_char|character_portrait_url:32 }}" class="img-circle">
</td>
@@ -69,7 +69,7 @@
{% endfor %}
</tbody>
</table>
<p class="text-muted"><i class="fa fa-star"></i>: Group leader</p>
<p class="text-muted"><i class="fas fa-star"></i>: Group leader</p>
</div>
{% else %}
<div class="alert alert-warning text-center">

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Groups Membership" %}{% endblock page_title %}
@@ -11,7 +11,7 @@
{% include 'groupmanagement/menu.html' %}
<div class="panel panel-default">
<div class="panel-heading">
Groups
{% trans "Groups" %}
</div>
<div class="panel-body">
{% if groups %}
@@ -53,6 +53,10 @@
<a href="{% url "groupmanagement:audit_log" group.id %}" class="btn btn-info" title="{% trans "Audit Members" %}">
<i class="glyphicon glyphicon-list-alt"></i>
</a>
<a id="clipboard-copy" data-clipboard-text="{{ request.scheme }}://{{request.get_host}}{% url 'groupmanagement:request_add' group.id %}" class="btn btn-warning" title="{% trans "Copy Direct Join Link" %}">
<i class="glyphicon glyphicon-copy"></i>
</a>
</td>
</tr>
{% endfor %}
@@ -68,3 +72,9 @@
</div>
</div>
{% endblock content %}
{% block extra_javascript %}
{% include 'bundles/clipboard-js.html' %}
<script>
new ClipboardJS('#clipboard-copy');
</script>
{% endblock %}

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Available Groups" %}{% endblock page_title %}

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% load evelinks %}
@@ -20,8 +20,22 @@
{% include 'groupmanagement/menu.html' %}
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#add">{% trans "Join Requests" %}</a></li>
<li><a data-toggle="tab" href="#leave">{% trans "Leave Requests" %}</a></li>
<li class="active">
<a data-toggle="tab" href="#add">
{% trans "Join Requests" %}
{% if acceptrequests %}
<span class="badge">{{ acceptrequests|length }}</span>
{% endif %}
</a>
</li>
<li>
<a data-toggle="tab" href="#leave">
{% trans "Leave Requests" %}
{% if leaverequests %}
<span class="badge">{{ leaverequests|length }}</span>
{% endif %}
</a>
</li>
</ul>
<div class="tab-content">

View File

@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% load navactive %}

View File

@@ -11,11 +11,7 @@ from allianceauth.eveonline.models import (
EveCharacter, EveCorporationInfo, EveAllianceInfo
)
from ..admin import (
HasLeaderFilter,
GroupAdmin,
Group
)
from ..admin import HasLeaderFilter, GroupAdmin, Group
from . import get_admin_change_view_url
if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS:
@@ -88,33 +84,33 @@ class TestGroupAdmin(TestCase):
# user 1 - corp and alliance, normal user
cls.character_1 = EveCharacter.objects.create(
character_id='1001',
character_id=1001,
character_name='Bruce Wayne',
corporation_id='2001',
corporation_id=2001,
corporation_name='Wayne Technologies',
corporation_ticker='WT',
alliance_id='3001',
alliance_id=3001,
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
)
cls.character_1a = EveCharacter.objects.create(
character_id='1002',
character_id=1002,
character_name='Batman',
corporation_id='2001',
corporation_id=2001,
corporation_name='Wayne Technologies',
corporation_ticker='WT',
alliance_id='3001',
alliance_id=3001,
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
)
alliance = EveAllianceInfo.objects.create(
alliance_id='3001',
alliance_id=3001,
alliance_name='Wayne Enterprises',
alliance_ticker='WE',
executor_corp_id='2001'
executor_corp_id=2001
)
EveCorporationInfo.objects.create(
corporation_id='2001',
corporation_id=2001,
corporation_name='Wayne Technologies',
corporation_ticker='WT',
member_count=42,
@@ -189,10 +185,10 @@ class TestGroupAdmin(TestCase):
alliance=None
)
EveAllianceInfo.objects.create(
alliance_id='3101',
alliance_id=3101,
alliance_name='Lex World Domination',
alliance_ticker='LWD',
executor_corp_id=''
executor_corp_id=2101
)
cls.user_3 = User.objects.create_user(
cls.character_3.character_name.replace(' ', '_'),
@@ -219,8 +215,8 @@ class TestGroupAdmin(TestCase):
"""create autogroups for corps and alliances"""
if _has_auto_groups:
autogroups_config = AutogroupsConfig(
corp_groups = True,
alliance_groups = True
corp_groups=True,
alliance_groups=True
)
autogroups_config.save()
for state in State.objects.all():
@@ -277,7 +273,7 @@ class TestGroupAdmin(TestCase):
if _has_auto_groups:
@patch(MODULE_PATH + '._has_auto_groups', True)
def test_properties_6(self):
def test_properties_7(self):
self._create_autogroups()
expected = ['Auto Group']
my_group = Group.objects\
@@ -337,8 +333,8 @@ class TestGroupAdmin(TestCase):
changelist = my_modeladmin.get_changelist_instance(request)
queryset = changelist.get_queryset(request)
expected = Group.objects.exclude(
managedalliancegroup__isnull=True,
managedcorpgroup__isnull=True
managedalliancegroup__isnull=True,
managedcorpgroup__isnull=True
)
self.assertSetEqual(set(queryset), set(expected))
@@ -394,4 +390,4 @@ class TestGroupAdmin(TestCase):
c = Client()
c.login(username='superuser', password='secret')
response = c.get(get_admin_change_view_url(self.group_1))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.status_code, 200)

View File

@@ -1,107 +0,0 @@
from unittest import mock
from django.test import TestCase
from allianceauth.tests.auth_utils import AuthUtils
from allianceauth.eveonline.models import EveCorporationInfo, EveAllianceInfo, EveCharacter
from django.contrib.auth.models import User, Group
from allianceauth.groupmanagement.managers import GroupManager
from allianceauth.groupmanagement.signals import check_groups_on_state_change
class GroupManagementVisibilityTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST')
cls.user.profile.refresh_from_db()
cls.alliance = EveAllianceInfo.objects.create(alliance_id='3', alliance_name='test alliance', alliance_ticker='TEST', executor_corp_id='2')
cls.corp = EveCorporationInfo.objects.create(corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', alliance=cls.alliance, member_count=1)
cls.group1 = Group.objects.create(name='group1')
cls.group2 = Group.objects.create(name='group2')
cls.group3 = Group.objects.create(name='group3')
def setUp(self):
self.user.refresh_from_db()
def _refresh_user(self):
self.user = User.objects.get(pk=self.user.pk)
def test_get_group_leaders_groups(self):
self.group1.authgroup.group_leaders.add(self.user)
self.group2.authgroup.group_leader_groups.add(self.group1)
self._refresh_user()
groups = GroupManager.get_group_leaders_groups(self.user)
self.assertIn(self.group1, groups) #avail due to user
self.assertNotIn(self.group2, groups) #not avail due to group
self.assertNotIn(self.group3, groups) #not avail at all
self.user.groups.add(self.group1)
self._refresh_user()
groups = GroupManager.get_group_leaders_groups(self.user)
self.assertIn(self.group1, groups) #avail due to user
self.assertIn(self.group2, groups) #avail due to group1
self.assertNotIn(self.group3, groups) #not avail at all
def test_can_manage_group(self):
self.group1.authgroup.group_leaders.add(self.user)
self.user.groups.add(self.group1)
self._refresh_user()
self.assertTrue(GroupManager.can_manage_group(self.user, self.group1))
self.assertFalse(GroupManager.can_manage_group(self.user, self.group2))
self.assertFalse(GroupManager.can_manage_group(self.user, self.group3))
self.group2.authgroup.group_leader_groups.add(self.group1)
self.group1.authgroup.group_leaders.remove(self.user)
self._refresh_user()
self.assertFalse(GroupManager.can_manage_group(self.user, self.group1))
self.assertTrue(GroupManager.can_manage_group(self.user, self.group2))
self.assertFalse(GroupManager.can_manage_group(self.user, self.group3))
class GroupManagementStateTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST')
cls.user.profile.refresh_from_db()
cls.alliance = EveAllianceInfo.objects.create(alliance_id='3', alliance_name='test alliance', alliance_ticker='TEST', executor_corp_id='2')
cls.corp = EveCorporationInfo.objects.create(corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', alliance=cls.alliance, member_count=1)
cls.state_group = Group.objects.create(name='state_group')
cls.open_group = Group.objects.create(name='open_group')
cls.state = AuthUtils.create_state('test state', 500)
cls.state_group.authgroup.states.add(cls.state)
cls.state_group.authgroup.internal = False
cls.state_group.save()
def setUp(self):
self.user.refresh_from_db()
self.state.refresh_from_db()
def _refresh_user(self):
self.user = User.objects.get(pk=self.user.pk)
def _refresh_test_group(self):
self.state_group = Group.objects.get(pk=self.state_group.pk)
def test_drop_state_group(self):
self.user.groups.add(self.open_group)
self.user.groups.add(self.state_group)
self.assertEqual(self.user.profile.state.name, "Guest")
self.state.member_corporations.add(self.corp)
self._refresh_user()
self.assertEqual(self.user.profile.state, self.state)
groups = self.user.groups.all()
self.assertIn(self.state_group, groups) #keeps group
self.assertIn(self.open_group, groups) #public group unafected
self.state.member_corporations.clear()
self._refresh_user()
self.assertEqual(self.user.profile.state.name, "Guest")
groups = self.user.groups.all()
self.assertNotIn(self.state_group, groups) #looses group
self.assertIn(self.open_group, groups) #public group unafected

View File

@@ -0,0 +1,427 @@
from unittest.mock import Mock, patch
from django.contrib.auth.models import Group, User
from django.test import TestCase
from django.urls import reverse
from allianceauth.eveonline.models import EveCorporationInfo, EveAllianceInfo
from allianceauth.tests.auth_utils import AuthUtils
from ..models import GroupRequest
from ..managers import GroupManager
class MockUserNotAuthenticated():
def __init__(self):
self.is_authenticated = False
class GroupManagementVisibilityTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(
cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST'
)
cls.user.profile.refresh_from_db()
cls.alliance = EveAllianceInfo.objects.create(alliance_id='3', alliance_name='test alliance', alliance_ticker='TEST', executor_corp_id='2')
cls.corp = EveCorporationInfo.objects.create(
corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', alliance=cls.alliance, member_count=1
)
cls.group1 = Group.objects.create(name='group1')
cls.group2 = Group.objects.create(name='group2')
cls.group3 = Group.objects.create(name='group3')
def setUp(self):
self.user.refresh_from_db()
def _refresh_user(self):
self.user = User.objects.get(pk=self.user.pk)
def test_get_group_leaders_groups(self):
self.group1.authgroup.group_leaders.add(self.user)
self.group2.authgroup.group_leader_groups.add(self.group1)
self._refresh_user()
groups = GroupManager.get_group_leaders_groups(self.user)
self.assertIn(self.group1, groups) #avail due to user
self.assertNotIn(self.group2, groups) #not avail due to group
self.assertNotIn(self.group3, groups) #not avail at all
self.user.groups.add(self.group1)
self._refresh_user()
groups = GroupManager.get_group_leaders_groups(self.user)
def test_can_manage_group(self):
self.group1.authgroup.group_leaders.add(self.user)
self.user.groups.add(self.group1)
self._refresh_user()
self.assertTrue(GroupManager.can_manage_group(self.user, self.group1))
self.assertFalse(GroupManager.can_manage_group(self.user, self.group2))
self.assertFalse(GroupManager.can_manage_group(self.user, self.group3))
self.group2.authgroup.group_leader_groups.add(self.group1)
self.group1.authgroup.group_leaders.remove(self.user)
self._refresh_user()
self.assertFalse(GroupManager.can_manage_group(self.user, self.group1))
self.assertTrue(GroupManager.can_manage_group(self.user, self.group2))
self.assertFalse(GroupManager.can_manage_group(self.user, self.group3))
class TestGroupManager(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# group 1
cls.group_default = Group.objects.create(name='default')
cls.group_default.authgroup.description = 'Default Group'
cls.group_default.authgroup.internal = False
cls.group_default.authgroup.hidden = False
cls.group_default.authgroup.save()
# group 2
cls.group_internal = Group.objects.create(name='internal')
cls.group_internal.authgroup.description = 'Internal Group'
cls.group_internal.authgroup.internal = True
cls.group_internal.authgroup.save()
# group 3
cls.group_hidden = Group.objects.create(name='hidden')
cls.group_hidden.authgroup.description = 'Hidden Group'
cls.group_hidden.authgroup.internal = False
cls.group_hidden.authgroup.hidden = True
cls.group_hidden.authgroup.save()
# group 4
cls.group_open = Group.objects.create(name='open')
cls.group_open.authgroup.description = 'Open Group'
cls.group_open.authgroup.internal = False
cls.group_open.authgroup.hidden = False
cls.group_open.authgroup.open = True
cls.group_open.authgroup.save()
# group 5
cls.group_public_1 = Group.objects.create(name='public 1')
cls.group_public_1.authgroup.description = 'Public Group 1'
cls.group_public_1.authgroup.internal = False
cls.group_public_1.authgroup.hidden = False
cls.group_public_1.authgroup.public = True
cls.group_public_1.authgroup.save()
# group 6
cls.group_public_2 = Group.objects.create(name='public 2')
cls.group_public_2.authgroup.description = 'Public Group 2'
cls.group_public_2.authgroup.internal = False
cls.group_public_2.authgroup.hidden = True
cls.group_public_2.authgroup.open = True
cls.group_public_2.authgroup.public = True
cls.group_public_2.authgroup.save()
# group 7
cls.group_default_member = Group.objects.create(name='default members')
cls.group_default_member.authgroup.description = \
'Default Group for members only'
cls.group_default_member.authgroup.internal = False
cls.group_default_member.authgroup.hidden = False
cls.group_default_member.authgroup.open = False
cls.group_default_member.authgroup.public = False
cls.group_default_member.authgroup.states.add(
AuthUtils.get_member_state()
)
cls.group_default_member.authgroup.save()
def setUp(self):
self.user = AuthUtils.create_user('Bruce Wayne')
def test_get_joinable_group_member(self):
result = GroupManager.get_joinable_groups(
AuthUtils.get_member_state()
)
expected = {
self.group_default,
self.group_hidden,
self.group_open,
self.group_public_1,
self.group_public_2,
self.group_default_member
}
self.assertSetEqual(set(result), expected)
def test_get_joinable_group_guest(self):
result = GroupManager.get_joinable_groups(
AuthUtils.get_guest_state()
)
expected = {
self.group_default,
self.group_hidden,
self.group_open,
self.group_public_1,
self.group_public_2
}
self.assertSetEqual(set(result), expected)
def test_joinable_group_member(self):
member_state = AuthUtils.get_member_state()
for x in [
self.group_default,
self.group_hidden,
self.group_open,
self.group_public_1,
self.group_public_2,
self.group_default_member
]:
self.assertTrue(GroupManager.joinable_group(x, member_state))
for x in [
self.group_internal,
]:
self.assertFalse(GroupManager.joinable_group(x, member_state))
def test_joinable_group_guest(self):
guest_state = AuthUtils.get_guest_state()
for x in [
self.group_default,
self.group_hidden,
self.group_open,
self.group_public_1,
self.group_public_2
]:
self.assertTrue(GroupManager.joinable_group(x, guest_state))
for x in [
self.group_internal,
self.group_default_member
]:
self.assertFalse(GroupManager.joinable_group(x, guest_state))
def test_get_all_non_internal_groups(self):
result = GroupManager.get_all_non_internal_groups()
expected = {
self.group_default,
self.group_hidden,
self.group_open,
self.group_public_1,
self.group_public_2,
self.group_default_member
}
self.assertSetEqual(set(result), expected)
def test_check_internal_group(self):
self.assertTrue(
GroupManager.check_internal_group(self.group_default)
)
self.assertFalse(
GroupManager.check_internal_group(self.group_internal)
)
def test_get_joinable_groups_for_user_no_permission(self):
AuthUtils.assign_state(self.user, AuthUtils.get_guest_state())
result = GroupManager.get_joinable_groups_for_user(self.user)
expected = {self.group_public_1, self.group_public_2}
self.assertSetEqual(set(result), expected)
def test_get_joinable_groups_for_user_guest_w_permission_(self):
AuthUtils.assign_state(self.user, AuthUtils.get_guest_state())
AuthUtils.add_permission_to_user_by_name(
'groupmanagement.request_groups', self.user
)
result = GroupManager.get_joinable_groups_for_user(self.user)
expected = {
self.group_default,
self.group_hidden,
self.group_open,
self.group_public_1,
self.group_public_2
}
self.assertSetEqual(set(result), expected)
def test_get_joinable_groups_for_user_member_w_permission(self):
AuthUtils.assign_state(self.user, AuthUtils.get_member_state(), True)
AuthUtils.add_permission_to_user_by_name(
'groupmanagement.request_groups', self.user
)
result = GroupManager.get_joinable_groups_for_user(self.user)
expected = {
self.group_default,
self.group_hidden,
self.group_open,
self.group_public_1,
self.group_public_2,
self.group_default_member
}
self.assertSetEqual(set(result), expected)
def test_get_joinable_groups_for_user_member_w_permission_no_hidden(self):
AuthUtils.assign_state(self.user, AuthUtils.get_member_state(), True)
AuthUtils.add_permission_to_user_by_name(
'groupmanagement.request_groups', self.user
)
result = GroupManager.get_joinable_groups_for_user(
self.user, include_hidden=False
)
expected = {
self.group_default,
self.group_open,
self.group_public_1,
self.group_default_member
}
self.assertSetEqual(set(result), expected)
def test_has_management_permission(self):
user = AuthUtils.create_user('Clark Kent')
AuthUtils.add_permission_to_user_by_name(
'auth.group_management', user
)
self.assertTrue(GroupManager.has_management_permission(user))
def test_can_manage_groups_no_perm_no_group(self):
user = AuthUtils.create_user('Clark Kent')
self.assertFalse(GroupManager.can_manage_groups(user))
def test_can_manage_groups_user_not_authenticated(self):
user = MockUserNotAuthenticated()
self.assertFalse(GroupManager.can_manage_groups(user))
def test_can_manage_groups_has_perm(self):
user = AuthUtils.create_user('Clark Kent')
AuthUtils.add_permission_to_user_by_name(
'auth.group_management', user
)
self.assertTrue(GroupManager.can_manage_groups(user))
def test_can_manage_groups_no_perm_leads_group(self):
user = AuthUtils.create_user('Clark Kent')
self.group_default.authgroup.group_leaders.add(user)
self.assertTrue(GroupManager.can_manage_groups(user))
def test_can_manage_group_no_perm_no_group(self):
user = AuthUtils.create_user('Clark Kent')
self.assertFalse(
GroupManager.can_manage_group(user, self.group_default)
)
def test_can_manage_group_has_perm(self):
user = AuthUtils.create_user('Clark Kent')
AuthUtils.add_permission_to_user_by_name(
'auth.group_management', user
)
self.assertTrue(
GroupManager.can_manage_group(user, self.group_default)
)
def test_can_manage_group_no_perm_leads_correct_group(self):
user = AuthUtils.create_user('Clark Kent')
self.group_default.authgroup.group_leaders.add(user)
self.assertTrue(
GroupManager.can_manage_group(user, self.group_default)
)
def test_can_manage_group_no_perm_leads_other_group(self):
user = AuthUtils.create_user('Clark Kent')
self.group_hidden.authgroup.group_leaders.add(user)
self.assertFalse(
GroupManager.can_manage_group(user, self.group_default)
)
def test_can_manage_group_user_not_authenticated(self):
user = MockUserNotAuthenticated()
self.assertFalse(
GroupManager.can_manage_group(user, self.group_default)
)
class TestPendingRequestsCountForUser(TestCase):
def setUp(self) -> None:
self.group_1 = Group.objects.create(name="Group 1")
self.group_2 = Group.objects.create(name="Group 2")
self.user_leader_1 = AuthUtils.create_member('Clark Kent')
self.group_1.authgroup.group_leaders.add(self.user_leader_1)
self.user_leader_2 = AuthUtils.create_member('Peter Parker')
self.group_2.authgroup.group_leaders.add(self.user_leader_2)
self.user_requestor = AuthUtils.create_member('Bruce Wayne')
def test_single_request_for_leader(self):
# given user_leader_1 is leader of group_1
# and user_leader_2 is leader of group_2
# when user_requestor is requesting access to group 1
# then return 1 for user_leader 1 and 0 for user_leader_2
GroupRequest.objects.create(
status="pending", user=self.user_requestor, group=self.group_1
)
self.assertEqual(
GroupManager.pending_requests_count_for_user(self.user_leader_1), 1
)
self.assertEqual(
GroupManager.pending_requests_count_for_user(self.user_leader_2), 0
)
def test_return_none_for_none_leader(self):
# given user_requestor is leader of no group
# when user_requestor is requesting access to group 1
# then return 0 for user_requestor
GroupRequest.objects.create(
status="pending", user=self.user_requestor, group=self.group_1
)
self.assertEqual(
GroupManager.pending_requests_count_for_user(self.user_requestor), 0
)
def test_single_leave_request(self):
# given user_leader_2 is leader of group_2
# and user_requestor is member of group 2
# when user_requestor is requesting to leave group 2
# then return 1 for user_leader_2
self.user_requestor.groups.add(self.group_2)
GroupRequest.objects.create(
status="pending",
user=self.user_requestor,
group=self.group_2,
leave_request=True
)
self.assertEqual(
GroupManager.pending_requests_count_for_user(self.user_leader_2), 1
)
def test_join_and_leave_request(self):
# given user_leader_2 is leader of group_2
# and user_requestor is member of group 2
# when user_requestor is requesting to leave group 2
# and user_requestor_2 is requesting to join group 2
# then return 2 for user_leader_2
self.user_requestor.groups.add(self.group_2)
user_requestor_2 = AuthUtils.create_member("Lex Luther")
GroupRequest.objects.create(
status="pending",
user=user_requestor_2,
group=self.group_2
)
GroupRequest.objects.create(
status="pending",
user=self.user_requestor,
group=self.group_2,
leave_request=True
)
self.assertEqual(
GroupManager.pending_requests_count_for_user(self.user_leader_2), 2
)
def test_single_request_for_user_with_management_perm(self):
# given user_leader_4 which is leafer of no group
# but has the management permissions
# when user_requestor is requesting access to group 1
# then return 1 for user_leader_4
user_leader_4 = AuthUtils.create_member("Lex Luther")
AuthUtils.add_permission_to_user_by_name("auth.group_management", user_leader_4)
user_leader_4 = User.objects.get(pk=user_leader_4.pk)
GroupRequest.objects.create(
status="pending", user=self.user_requestor, group=self.group_1
)
self.assertEqual(
GroupManager.pending_requests_count_for_user(self.user_leader_1), 1
)

View File

@@ -0,0 +1,167 @@
from unittest import mock
from django.contrib.auth.models import User, Group
from django.test import TestCase
from allianceauth.tests.auth_utils import AuthUtils
from allianceauth.eveonline.models import (
EveCorporationInfo, EveAllianceInfo, EveCharacter
)
from ..models import GroupRequest, RequestLog
def create_testdata():
# clear DB
User.objects.all().delete()
Group.objects.all().delete()
EveCharacter.objects.all().delete()
EveCorporationInfo.objects.all().delete()
EveAllianceInfo.objects.all().delete()
# group 1
group = Group.objects.create(name='Superheros')
group.authgroup.description = 'Default Group'
group.authgroup.internal = False
group.authgroup.hidden = False
group.authgroup.save()
# user 1
user_1 = AuthUtils.create_user('Bruce Wayne')
AuthUtils.add_main_character_2(
user_1,
name='Bruce Wayne',
character_id=1001,
corp_id=2001,
corp_name='Wayne Technologies'
)
user_1.groups.add(group)
group.authgroup.group_leaders.add(user_1)
# user 2
user_2 = AuthUtils.create_user('Clark Kent')
AuthUtils.add_main_character_2(
user_2,
name='Clark Kent',
character_id=1002,
corp_id=2002,
corp_name='Wayne Technologies'
)
return group, user_1, user_2
class TestGroupRequest(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.group, cls.user_1, _ = create_testdata()
def test_main_char(self):
group_request = GroupRequest.objects.create(
status='Pending',
user=self.user_1,
group=self.group
)
expected = self.user_1.profile.main_character
self.assertEqual(group_request.main_char, expected)
def test_str(self):
group_request = GroupRequest.objects.create(
status='Pending',
user=self.user_1,
group=self.group
)
expected = 'Bruce Wayne:Superheros'
self.assertEqual(str(group_request), expected)
class TestRequestLog(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.group, cls.user_1, cls.user_2 = create_testdata()
def test_requestor(self):
request_log = RequestLog.objects.create(
group=self.group,
request_info='Clark Kent:Superheros',
request_actor=self.user_1
)
expected = 'Clark Kent'
self.assertEqual(request_log.requestor(), expected)
def test_type_to_str_removed(self):
request_log = RequestLog.objects.create(
request_type=None,
group=self.group,
request_info='Clark Kent:Superheros',
request_actor=self.user_1
)
expected = 'Removed'
self.assertEqual(request_log.type_to_str(), expected)
def test_type_to_str_leave(self):
request_log = RequestLog.objects.create(
request_type=True,
group=self.group,
request_info='Clark Kent:Superheros',
request_actor=self.user_1
)
expected = 'Leave'
self.assertEqual(request_log.type_to_str(), expected)
def test_type_to_str_join(self):
request_log = RequestLog.objects.create(
request_type=False,
group=self.group,
request_info='Clark Kent:Superheros',
request_actor=self.user_1
)
expected = 'Join'
self.assertEqual(request_log.type_to_str(), expected)
def test_action_to_str_accept(self):
request_log = RequestLog.objects.create(
group=self.group,
request_info='Clark Kent:Superheros',
request_actor=self.user_1,
action = True
)
expected = 'Accept'
self.assertEqual(request_log.action_to_str(), expected)
def test_action_to_str_reject(self):
request_log = RequestLog.objects.create(
group=self.group,
request_info='Clark Kent:Superheros',
request_actor=self.user_1,
action = False
)
expected = 'Reject'
self.assertEqual(request_log.action_to_str(), expected)
def test_req_char(self):
request_log = RequestLog.objects.create(
group=self.group,
request_info='Clark Kent:Superheros',
request_actor=self.user_1,
action = False
)
expected = self.user_2.profile.main_character
self.assertEqual(request_log.req_char(), expected)
class TestAuthGroup(TestCase):
def test_str(self):
group = Group.objects.create(name='Superheros')
group.authgroup.description = 'Default Group'
group.authgroup.internal = False
group.authgroup.hidden = False
group.authgroup.save()
expected = 'Superheros'
self.assertEqual(str(group.authgroup), expected)

View File

@@ -0,0 +1,61 @@
from unittest import mock
from django.test import TestCase
from django.contrib.auth.models import User, Group
from allianceauth.eveonline.models import EveCorporationInfo, EveAllianceInfo
from allianceauth.tests.auth_utils import AuthUtils
from ..signals import check_groups_on_state_change
class GroupManagementStateTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(
cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST'
)
cls.user.profile.refresh_from_db()
cls.alliance = EveAllianceInfo.objects.create(
alliance_id='3', alliance_name='test alliance', alliance_ticker='TEST', executor_corp_id='2'
)
cls.corp = EveCorporationInfo.objects.create(
corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', alliance=cls.alliance, member_count=1
)
cls.state_group = Group.objects.create(name='state_group')
cls.open_group = Group.objects.create(name='open_group')
cls.state = AuthUtils.create_state('test state', 500)
cls.state_group.authgroup.states.add(cls.state)
cls.state_group.authgroup.internal = False
cls.state_group.save()
def setUp(self):
self.user.refresh_from_db()
self.state.refresh_from_db()
def _refresh_user(self):
self.user = User.objects.get(pk=self.user.pk)
def _refresh_test_group(self):
self.state_group = Group.objects.get(pk=self.state_group.pk)
def test_drop_state_group(self):
self.user.groups.add(self.open_group)
self.user.groups.add(self.state_group)
self.assertEqual(self.user.profile.state.name, "Guest")
self.state.member_corporations.add(self.corp)
self._refresh_user()
self.assertEqual(self.user.profile.state, self.state)
groups = self.user.groups.all()
self.assertIn(self.state_group, groups) #keeps group
self.assertIn(self.open_group, groups) #public group unafected
self.state.member_corporations.clear()
self._refresh_user()
self.assertEqual(self.user.profile.state.name, "Guest")
groups = self.user.groups.all()
self.assertNotIn(self.state_group, groups) #looses group
self.assertIn(self.open_group, groups) #public group unafected

View File

@@ -0,0 +1,22 @@
from unittest.mock import Mock, patch
from django.test import RequestFactory, TestCase
from django.urls import reverse
from allianceauth.tests.auth_utils import AuthUtils
from esi.models import Token
from .. import views
class TestViews(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.user = AuthUtils.create_user('Bruce Wayne')
def test_groups_view_can_load(self):
request = self.factory.get(reverse('groupmanagement:groups'))
request.user = self.user
response = views.groups_view(request)
self.assertEqual(response.status_code, 200)

View File

@@ -1,32 +1,29 @@
from . import views
from django.conf.urls import include, url
from django.conf.urls import url
app_name = 'groupmanagement'
urlpatterns = [
url(r'^groups/', views.groups_view, name='groups'),
url(r'^group/', include([
url(r'^management/', views.group_management,
name='management'),
url(r'^membership/$', views.group_membership,
name='membership'),
url(r'^membership/(\w+)/$', views.group_membership_list,
name='membership_list'),
url(r'^membership/(\w+)/audit/$', views.group_membership_audit, name="audit_log"),
url(r'^membership/(\w+)/remove/(\w+)/$', views.group_membership_remove,
name='membership_remove'),
url(r'^request_add/(\w+)', views.group_request_add,
name='request_add'),
url(r'^request/accept/(\w+)', views.group_accept_request,
name='accept_request'),
url(r'^request/reject/(\w+)', views.group_reject_request,
name='reject_request'),
url(r'^request_leave/(\w+)', views.group_request_leave,
name='request_leave'),
url(r'leave_request/accept/(\w+)', views.group_leave_accept_request,
name='leave_accept_request'),
url(r'^leave_request/reject/(\w+)', views.group_leave_reject_request,
name='leave_reject_request'),
])),
url(r'^groups/', views.groups_view, name='groups'),
url(r'^management/', views.group_management,
name='management'),
url(r'^membership/$', views.group_membership,
name='membership'),
url(r'^membership/(\w+)/$', views.group_membership_list,
name='membership_list'),
url(r'^membership/(\w+)/audit/$', views.group_membership_audit, name="audit_log"),
url(r'^membership/(\w+)/remove/(\w+)/$', views.group_membership_remove,
name='membership_remove'),
url(r'^request_add/(\w+)', views.group_request_add,
name='request_add'),
url(r'^request/accept/(\w+)', views.group_accept_request,
name='accept_request'),
url(r'^request/reject/(\w+)', views.group_reject_request,
name='reject_request'),
url(r'^request_leave/(\w+)', views.group_request_leave,
name='request_leave'),
url(r'leave_request/accept/(\w+)', views.group_leave_accept_request,
name='leave_accept_request'),
url(r'^leave_request/reject/(\w+)', views.group_leave_reject_request,
name='leave_reject_request'),
]

View File

@@ -1,21 +1,21 @@
import logging
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth.models import Group
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.core.paginator import Paginator, EmptyPage
from django.db.models import Count
from django.http import Http404
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from .managers import GroupManager
from .models import GroupRequest, RequestLog
from allianceauth.notifications import notify
from django.conf import settings
from .managers import GroupManager
from .models import GroupRequest, RequestLog
logger = logging.getLogger(__name__)
@@ -27,7 +27,7 @@ def group_management(request):
acceptrequests = []
leaverequests = []
base_group_query = GroupRequest.objects.select_related('user', 'group')
base_group_query = GroupRequest.objects.select_related('user', 'group', 'user__profile__main_character')
if GroupManager.has_management_permission(request.user):
# Full access
group_requests = base_group_query.all()
@@ -75,7 +75,6 @@ def group_membership_audit(request, group_id):
logger.debug("group_management_audit called by user %s" % request.user)
group = get_object_or_404(Group, id=group_id)
try:
# Check its a joinable group i.e. not corp or internal
# And the user has permission to manage it
if not GroupManager.check_internal_group(group) or not GroupManager.can_manage_group(request.user, group):
@@ -92,8 +91,6 @@ def group_membership_audit(request, group_id):
return render(request, 'groupmanagement/audit.html', context=render_items)
@login_required
@user_passes_test(GroupManager.can_manage_groups)
def group_membership_list(request, group_id):
@@ -123,7 +120,7 @@ def group_membership_list(request, group_id):
for member in \
group.user_set\
.all()\
.select_related('profile')\
.select_related('profile', 'profile__main_character')\
.order_by('profile__main_character__character_name'):
members.append({
@@ -235,7 +232,7 @@ def group_reject_request(request, group_request_id):
raise p
except:
messages.error(request, _('An unhandled error occurred while processing the application from %(mainchar)s to %(group)s.') % {"mainchar": group_request.main_char, "group": group_request.group})
logger.exception("Unhandled exception occured while user %s attempting to reject group request id %s" % (
logger.exception("Unhandled exception occurred while user %s attempting to reject group request id %s" % (
request.user, group_request_id))
pass
@@ -269,9 +266,9 @@ def group_leave_accept_request(request, group_request_id):
(request.user, group_request_id))
raise p
except:
messages.error(request, _('An unhandled error occured while processing the application from %(mainchar)s to leave %(group)s.') % {
messages.error(request, _('An unhandled error occurred while processing the application from %(mainchar)s to leave %(group)s.') % {
"mainchar": group_request.main_char, "group": group_request.group})
logger.exception("Unhandled exception occured while user %s attempting to accept group leave request id %s" % (
logger.exception("Unhandled exception occurred while user %s attempting to accept group leave request id %s" % (
request.user, group_request_id))
pass
@@ -303,9 +300,9 @@ def group_leave_reject_request(request, group_request_id):
(request.user, group_request_id))
raise p
except:
messages.error(request, _('An unhandled error occured while processing the application from %(mainchar)s to leave %(group)s.') % {
messages.error(request, _('An unhandled error occurred while processing the application from %(mainchar)s to leave %(group)s.') % {
"mainchar": group_request.main_char, "group": group_request.group})
logger.exception("Unhandled exception occured while user %s attempting to reject group leave request id %s" % (
logger.exception("Unhandled exception occurred while user %s attempting to reject group leave request id %s" % (
request.user, group_request_id))
pass
@@ -315,24 +312,23 @@ def group_leave_reject_request(request, group_request_id):
@login_required
def groups_view(request):
logger.debug("groups_view called by user %s" % request.user)
groups_qs = GroupManager.get_joinable_groups_for_user(
request.user, include_hidden=False
)
groups_qs = groups_qs.order_by('name')
groups = []
for group in groups_qs:
group_request = GroupRequest.objects\
.filter(user=request.user)\
.filter(group=group)
groups.append({
'group': group,
'request': group_request[0] if group_request else None
})
group_query = GroupManager.get_joinable_groups(request.user.profile.state)
if not request.user.has_perm('groupmanagement.request_groups'):
# Filter down to public groups only for non-members
group_query = group_query.filter(authgroup__public=True)
logger.debug("Not a member, only public groups will be available")
for group in group_query:
# Exclude hidden
if not group.authgroup.hidden:
group_request = GroupRequest.objects.filter(user=request.user).filter(group=group)
groups.append({'group': group, 'request': group_request[0] if group_request else None})
render_items = {'groups': groups}
return render(request, 'groupmanagement/groups.html', context=render_items)
context = {'groups': groups}
return render(request, 'groupmanagement/groups.html', context=context)
@login_required
@@ -349,13 +345,13 @@ def group_request_add(request, group_id):
# User is already a member of this group.
logger.warning("User %s attempted to join group id %s but they are already a member." %
(request.user, group_id))
messages.warning(request, "You are already a member of that group.")
messages.warning(request, _("You are already a member of that group."))
return redirect('groupmanagement:groups')
if not request.user.has_perm('groupmanagement.request_groups') and not group.authgroup.public:
# Does not have the required permission, trying to join a non-public group
logger.warning("User %s attempted to join group id %s but it is not a public group" %
(request.user, group_id))
messages.warning(request, "You cannot join that group")
messages.warning(request, _("You cannot join that group"))
return redirect('groupmanagement:groups')
if group.authgroup.open:
logger.info("%s joining %s as is an open group" % (request.user, group))
@@ -364,7 +360,7 @@ def group_request_add(request, group_id):
req = GroupRequest.objects.filter(user=request.user, group=group)
if len(req) > 0:
logger.info("%s attempted to join %s but already has an open application" % (request.user, group))
messages.warning(request, "You already have a pending application for that group.")
messages.warning(request, _("You already have a pending application for that group."))
return redirect("groupmanagement:groups")
grouprequest = GroupRequest()
grouprequest.status = _('Pending')
@@ -398,7 +394,7 @@ def group_request_leave(request, group_id):
req = GroupRequest.objects.filter(user=request.user, group=group)
if len(req) > 0:
logger.info("%s attempted to leave %s but already has an pending leave request." % (request.user, group))
messages.warning(request, "You already have a pending leave request for that group.")
messages.warning(request, _("You already have a pending leave request for that group."))
return redirect("groupmanagement:groups")
if getattr(settings, 'AUTO_LEAVE', False):
logger.info("%s leaving joinable group %s due to auto_leave" % (request.user, group))

View File

@@ -1,17 +1,25 @@
from allianceauth.services.hooks import MenuItemHook, UrlHook
from django.utils.translation import ugettext_lazy as _
from allianceauth import hooks
from allianceauth.hrapplications import urls
from allianceauth.services.hooks import MenuItemHook, UrlHook
from . import urls
from .models import Application
class ApplicationsMenu(MenuItemHook):
def __init__(self):
MenuItemHook.__init__(self,
_('Applications'),
'fa fa-file-o fa-fw',
'far fa-file fa-fw',
'hrapplications:index',
navactive=['hrapplications:'])
def render(self, request):
app_count = Application.objects.pending_requests_count_for_user(request.user)
self.count = app_count if app_count and app_count > 0 else None
return MenuItemHook.render(self, request)
@hooks.register('menu_item_hook')
def register_menu():

View File

@@ -0,0 +1,25 @@
from django.contrib.auth.models import User
from django.db import models
from typing import Optional
class ApplicationManager(models.Manager):
def pending_requests_count_for_user(self, user: User) -> Optional[int]:
"""Returns the number of pending group requests for the given user"""
if user.is_superuser:
return self.filter(approved__isnull=True).count()
elif user.has_perm("auth.human_resources"):
main_character = user.profile.main_character
if main_character:
return (
self
.select_related("form__corp")
.filter(form__corp__corporation_id=main_character.corporation_id)
.filter(approved__isnull=True)
.count()
)
else:
return None
else:
return None

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.1.1 on 2020-09-18 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hrapplications', '0006_remove_legacy_models'),
]
operations = [
migrations.AlterField(
model_name='application',
name='approved',
field=models.BooleanField(blank=True, default=None, null=True),
),
]

View File

@@ -2,8 +2,9 @@ from django.contrib.auth.models import User
from django.db import models
from sortedm2m.fields import SortedManyToManyField
from allianceauth.eveonline.models import EveCharacter
from allianceauth.eveonline.models import EveCorporationInfo
from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo
from .managers import ApplicationManager
class ApplicationQuestion(models.Model):
@@ -22,6 +23,7 @@ class ApplicationChoice(models.Model):
def __str__(self):
return self.choice_text
class ApplicationForm(models.Model):
questions = SortedManyToManyField(ApplicationQuestion)
corp = models.OneToOneField(EveCorporationInfo, on_delete=models.CASCADE)
@@ -33,11 +35,13 @@ class ApplicationForm(models.Model):
class Application(models.Model):
form = models.ForeignKey(ApplicationForm, on_delete=models.CASCADE, related_name='applications')
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='applications')
approved = models.NullBooleanField(blank=True, null=True, default=None)
approved = models.BooleanField(blank=True, null=True, default=None)
reviewer = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)
reviewer_character = models.ForeignKey(EveCharacter, on_delete=models.SET_NULL, blank=True, null=True)
created = models.DateTimeField(auto_now_add=True)
objects = ApplicationManager()
def __str__(self):
return str(self.user) + " Application To " + str(self.form)

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Choose a Corp" %}{% endblock page_title %}

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Apply To" %} {{ corp.corporation_name }}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "HR Application Management" %}{% endblock page_title %}

View File

@@ -1,6 +1,6 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}HR Application Management{% endblock page_title %}

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load bootstrap %}
{% load i18n %}

View File

@@ -1 +1,103 @@
# Create your tests here.
from django.contrib.auth.models import User
from django.test import TestCase
from allianceauth.eveonline.models import EveCorporationInfo
from allianceauth.tests.auth_utils import AuthUtils
from .models import Application, ApplicationForm, ApplicationQuestion, ApplicationChoice
class TestApplicationManagersPendingRequestsCountForUser(TestCase):
def setUp(self) -> None:
self.corporation_1 = EveCorporationInfo.objects.create(
corporation_id=2001, corporation_name="Wayne Tech", member_count=42
)
self.corporation_2 = EveCorporationInfo.objects.create(
corporation_id=2011, corporation_name="Lex Corp", member_count=666
)
question = ApplicationQuestion.objects.create(title="Dummy Question")
ApplicationChoice.objects.create(question=question, choice_text="yes")
ApplicationChoice.objects.create(question=question, choice_text="no")
self.form_corporation_1 = ApplicationForm.objects.create(
corp=self.corporation_1
)
self.form_corporation_1.questions.add(question)
self.form_corporation_2 = ApplicationForm.objects.create(
corp=self.corporation_2
)
self.form_corporation_2.questions.add(question)
self.user_requestor = AuthUtils.create_member("Peter Parker")
self.user_manager = AuthUtils.create_member("Bruce Wayne")
AuthUtils.add_main_character_2(
self.user_manager,
self.user_manager.username,
1001,
self.corporation_1.corporation_id,
self.corporation_1.corporation_name,
)
AuthUtils.add_permission_to_user_by_name(
"auth.human_resources", self.user_manager
)
self.user_manager = User.objects.get(pk=self.user_manager.pk)
def test_no_pending_application(self):
# given manager of corporation 1 has permission
# when no application is pending for corporation 1
# return 0
self.assertEqual(
Application.objects.pending_requests_count_for_user(self.user_manager), 0
)
def test_single_pending_application(self):
# given manager of corporation 1 has permission
# when 1 application is pending for corporation 1
# return 1
Application.objects.create(
form=self.form_corporation_1, user=self.user_requestor
)
self.assertEqual(
Application.objects.pending_requests_count_for_user(self.user_manager), 1
)
def test_user_has_no_permission(self):
# given user has no permission
# when 1 application is pending
# return None
self.assertIsNone(
Application.objects.pending_requests_count_for_user(self.user_requestor)
)
def test_two_pending_applications_for_different_corporations_normal_manager(self):
# given manager of corporation 1 has permission
# when 1 application is pending for corporation 1
# and 1 application is pending for corporation 2
# return 1
Application.objects.create(
form=self.form_corporation_1, user=self.user_requestor
)
Application.objects.create(
form=self.form_corporation_2, user=self.user_requestor
)
self.assertEqual(
Application.objects.pending_requests_count_for_user(self.user_manager), 1
)
def test_two_pending_applications_for_different_corporations_manager_is_super(self):
# given manager of corporation 1 has permission
# when 1 application is pending for corporation 1
# and 1 application is pending for corporation 2
# return 1
Application.objects.create(
form=self.form_corporation_1, user=self.user_requestor
)
Application.objects.create(
form=self.form_corporation_2, user=self.user_requestor
)
superuser = User.objects.create_superuser(
"Superman", "superman@example.com", "password"
)
self.assertEqual(
Application.objects.pending_requests_count_for_user(superuser), 2
)

View File

@@ -4,18 +4,18 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Rounon Dax <rounon.dax@terra-nanotech.de>, 2020
# Erik Kalkoken <erik.kalkoken@gmail.com>, 2020
# Joel Falknau <ozirascal@gmail.com>, 2020
# Peter Pfeufer <rounon.dax@terra-nanotech.de>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-04 23:04+0000\n"
"POT-Creation-Date: 2020-10-11 03:43+0000\n"
"PO-Revision-Date: 2020-02-18 03:14+0000\n"
"Last-Translator: Joel Falknau <ozirascal@gmail.com>, 2020\n"
"Last-Translator: Peter Pfeufer <rounon.dax@terra-nanotech.de>, 2020\n"
"Language-Team: German (https://www.transifex.com/alliance-auth/teams/107430/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -28,61 +28,59 @@ msgid "A main character is required to perform that action. Add one below."
msgstr ""
"Für diese Aktion wird ein Hauptcharacter benötigt. Bitte füge einen hinzu."
#: allianceauth/authentication/forms.py:6
#: allianceauth/authentication/forms.py:5
msgid "Email"
msgstr "E-Mail"
#: allianceauth/authentication/models.py:76
msgid "State Changed"
msgstr "Status geändert"
#: allianceauth/authentication/models.py:77
#: allianceauth/authentication/models.py:78
#, python-format
msgid "Your user state has been changed to %(state)s"
msgstr "Dein Nutzerstatus hat sich geändert zu %(state)s"
msgid "State changed to: %s"
msgstr "Status geändert zu %s"
#: allianceauth/authentication/models.py:79
#, python-format
msgid "Your user's state is now: %(state)s"
msgstr "Dein Nutzerstatus ist nun %(state)s"
#: allianceauth/authentication/templates/authentication/dashboard.html:5
#: allianceauth/authentication/templates/authentication/dashboard.html:8
#: allianceauth/templates/allianceauth/side-menu.html:10
#: allianceauth/templates/allianceauth/side-menu.html:11
msgid "Dashboard"
msgstr "Dashboard"
#: allianceauth/authentication/templates/authentication/dashboard.html:17
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
msgstr "Hauptcharakter"
#: allianceauth/authentication/templates/authentication/dashboard.html:18
#, python-format
msgid ""
"\n"
" Main Character (State: %(state)s)\n"
" "
msgstr ""
"\n"
"Hauptcharakter (Status: %(state)s)"
#: allianceauth/authentication/templates/authentication/dashboard.html:77
#: allianceauth/authentication/templates/authentication/dashboard.html:81
msgid "No main character set."
msgstr "Kein Hauptcharakter gesetzt."
#: allianceauth/authentication/templates/authentication/dashboard.html:84
#: allianceauth/authentication/templates/authentication/dashboard.html:88
msgid "Add Character"
msgstr "Charakter hinzufügen"
#: allianceauth/authentication/templates/authentication/dashboard.html:88
#: allianceauth/authentication/templates/authentication/dashboard.html:92
msgid "Change Main"
msgstr "Hauptcharakter ändern"
#: allianceauth/authentication/templates/authentication/dashboard.html:97
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:15
msgid "Groups"
#: allianceauth/authentication/templates/authentication/dashboard.html:101
msgid "Group Memberships"
msgstr "Gruppen"
#: allianceauth/authentication/templates/authentication/dashboard.html:117
#: allianceauth/authentication/templates/authentication/dashboard.html:121
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:41
msgid "Characters"
msgstr "Charaktere"
#: allianceauth/authentication/templates/authentication/dashboard.html:125
#: allianceauth/authentication/templates/authentication/dashboard.html:129
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:73
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:22
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:15
@@ -91,13 +89,13 @@ msgstr "Charaktere"
msgid "Name"
msgstr "Name"
#: allianceauth/authentication/templates/authentication/dashboard.html:126
#: allianceauth/authentication/templates/authentication/dashboard.html:130
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticsview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:46
msgid "Corp"
msgstr "Corp"
#: allianceauth/authentication/templates/authentication/dashboard.html:127
#: allianceauth/authentication/templates/authentication/dashboard.html:131
#: allianceauth/corputils/templates/corputils/corpstats.html:77
#: allianceauth/hrapplications/templates/hrapplications/view.html:47
msgid "Alliance"
@@ -140,32 +138,41 @@ msgstr "Euer IT Team"
msgid "Submit"
msgstr "Absenden"
#: allianceauth/authentication/views.py:39
#: allianceauth/authentication/views.py:74
#, python-format
msgid ""
"Cannot change main character to %(char)s: character owned by a different "
"account."
msgstr ""
"Der Haputcharakter kann nicht zu %(char)s geändert werden. Dieser Charakter "
"gehört zu einem anderen Konto."
#: allianceauth/authentication/views.py:80
#, python-format
msgid "Changed main character to %(char)s"
msgstr "Haupcharakter geändert zu %(char)s"
#: allianceauth/authentication/views.py:48
#: allianceauth/authentication/views.py:89
#, python-format
msgid "Added %(name)s to your account."
msgstr "%(name)s zu Deinem Konto hinzugefügt."
#: allianceauth/authentication/views.py:50
#: allianceauth/authentication/views.py:91
#, python-format
msgid "Failed to add %(name)s to your account: they already have an account."
msgstr ""
"Es ist nicht möglich %(name)s zu Deinem Konto hinzu zu fügen: Dieser hat "
"bereits ein eigenes Konto."
#: allianceauth/authentication/views.py:89
#: allianceauth/authentication/views.py:130
msgid "Unable to authenticate as the selected character."
msgstr "Authentifizierung mit dem ausgewählten Charakter nicht möglich."
#: allianceauth/authentication/views.py:107
#: allianceauth/authentication/views.py:146
msgid "Registration token has expired."
msgstr "Token zur Registrierung ist abgelaufen."
#: allianceauth/authentication/views.py:159
#: allianceauth/authentication/views.py:201
msgid ""
"Sent confirmation email. Please follow the link to confirm your email "
"address."
@@ -173,12 +180,12 @@ msgstr ""
"Bestätigungsmail gesendet. Bitte folge dem Link in der E-Mail zur "
"Bestätigung."
#: allianceauth/authentication/views.py:164
#: allianceauth/authentication/views.py:206
msgid "Confirmed your email address. Please login to continue."
msgstr ""
"Deine E-Mail Adresse wurde bestätigt. Bitte log Dich ein um fortzufahren."
#: allianceauth/authentication/views.py:169
#: allianceauth/authentication/views.py:211
msgid "Registraion of new accounts it not allowed at this time."
msgstr "Registrierung von neuen Konten ist zur Zeit nicht erlaubt."
@@ -229,8 +236,8 @@ msgstr "Letzes Update:"
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:28
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:27
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:29
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:37
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:96
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:51
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:110
msgid "Character"
msgstr "Charakter"
@@ -252,6 +259,16 @@ msgstr "Corporation"
msgid "Killboard"
msgstr "Killboard"
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
msgstr "Hauptcharakter"
#: allianceauth/corputils/templates/corputils/corpstats.html:117
#: allianceauth/corputils/templates/corputils/search.html:17
msgid "Main Corporation"
@@ -535,11 +552,22 @@ msgstr "Flottenteilnahme registriert."
msgid "FAT link has expired."
msgstr "FAT-Link ist abgelaufen."
#: allianceauth/groupmanagement/auth_hooks.py:16
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
msgid "Group Management"
msgstr "Gruppenverwaltung"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:5
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:13
msgid "Audit Log"
msgstr "Protokoll"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:18
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:20
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr "Zurück"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:25
msgid "Date/Time"
msgstr "Datum/Uhrzeit"
@@ -581,8 +609,8 @@ msgid "Portrait"
msgstr "Portrait"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:30
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:38
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:52
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:111
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:23
msgid "Organization"
msgstr "Organization"
@@ -599,6 +627,12 @@ msgstr "Keine Gruppenmitglieder vorhanden."
msgid "Groups Membership"
msgstr "Gruppenmitgliedschaft"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:14
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:16
msgid "Groups"
msgstr "Gruppen"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:16
msgid "Description"
@@ -609,7 +643,7 @@ msgstr "Beschreibung"
#: allianceauth/hrapplications/templates/hrapplications/management.html:85
#: allianceauth/hrapplications/templates/hrapplications/management.html:130
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:27
#: allianceauth/srp/templates/srp/data.html:97
#: allianceauth/srp/templates/srp/data.html:98
msgid "Status"
msgstr "Status"
@@ -638,7 +672,11 @@ msgstr "Mitglieder ansehen"
msgid "Audit Members"
msgstr "Mitglieder Protokoll"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:64
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:56
msgid "Copy Direct Join Link"
msgstr "Direktlink kopieren"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:68
msgid "No groups to list."
msgstr "Keine Gruppen vorhanden."
@@ -667,37 +705,37 @@ msgstr "Keine Gruppen verfügbar"
msgid "Groups Management"
msgstr "Gruppenverwaltung"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:25
msgid "Join Requests"
msgstr "Beitrittsgesuche"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:24
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:33
msgid "Leave Requests"
msgstr "Austrittsgesuche"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:39
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:98
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:53
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:112
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:20
#: allianceauth/services/modules/openfire/forms.py:6
msgid "Group"
msgstr "Gruppen"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:71
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:130
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:85
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:144
msgid "Accept"
msgstr "Akzeptieren"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:74
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:133
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:88
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:147
#: allianceauth/hrapplications/templates/hrapplications/view.html:85
msgid "Reject"
msgstr "Ablehnen"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:83
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
msgid "No group add requests."
msgstr "Keine Gruppenbeitrittsanfragen."
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:142
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:156
msgid "No group leave requests."
msgstr "Keine Gruppenaustrittsanfragen"
@@ -705,11 +743,6 @@ msgstr "Keine Gruppenaustrittsanfragen"
msgid "Toggle navigation"
msgstr "Toggle Navigation"
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
#: allianceauth/templates/allianceauth/side-menu.html:23
msgid "Group Management"
msgstr "Gruppenverwaltung"
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:21
msgid "Group Requests"
msgstr "Gruppenanfragen"
@@ -718,26 +751,26 @@ msgstr "Gruppenanfragen"
msgid "Group Membership"
msgstr "Gruppenmitgliedschaft"
#: allianceauth/groupmanagement/views.py:164
#: allianceauth/groupmanagement/views.py:162
#, python-format
msgid "Removed user %(user)s from group %(group)s."
msgstr "Benutzer %(user)s von Gruppe %(group)s entfernt."
#: allianceauth/groupmanagement/views.py:166
#: allianceauth/groupmanagement/views.py:164
msgid "User does not exist in that group"
msgstr "Benutzer existiert nicht in dieser Gruppe"
#: allianceauth/groupmanagement/views.py:169
#: allianceauth/groupmanagement/views.py:167
msgid "Group does not exist"
msgstr "Gruppe existiert nicht"
#: allianceauth/groupmanagement/views.py:196
#: allianceauth/groupmanagement/views.py:194
#, python-format
msgid "Accepted application from %(mainchar)s to %(group)s."
msgstr "Beitrittsgesuch von %(mainchar)s zur Gruppe %(group)s zugestimmt."
#: allianceauth/groupmanagement/views.py:203
#: allianceauth/groupmanagement/views.py:236
#: allianceauth/groupmanagement/views.py:201
#: allianceauth/groupmanagement/views.py:234
#, python-format
msgid ""
"An unhandled error occurred while processing the application from "
@@ -746,67 +779,80 @@ msgstr ""
"Bei der Bearbeitung des Beitrittsgesuchs von %(mainchar)s zur Gruppe "
"%(group)s ist ein unbehandelter Fehler aufgetreten."
#: allianceauth/groupmanagement/views.py:229
#: allianceauth/groupmanagement/views.py:227
#, python-format
msgid "Rejected application from %(mainchar)s to %(group)s."
msgstr "Beitrittsgesuch von %(mainchar)s zur Gruppe %(group)s abgelehnt."
#: allianceauth/groupmanagement/views.py:265
#: allianceauth/groupmanagement/views.py:263
#, python-format
msgid "Accepted application from %(mainchar)s to leave %(group)s."
msgstr "Austrittsgesuch von %(mainchar)s für Gruppe %(group)s akzeptiert."
#: allianceauth/groupmanagement/views.py:271
#: allianceauth/groupmanagement/views.py:305
#: allianceauth/groupmanagement/views.py:269
#: allianceauth/groupmanagement/views.py:303
#, python-format
msgid ""
"An unhandled error occured while processing the application from "
"An unhandled error occurred while processing the application from "
"%(mainchar)s to leave %(group)s."
msgstr ""
"Bei der Bearbeitung des Austrittsgesuchs von %(mainchar)s für Gruppe "
"%(group)s ist ein unbehandelter Fehler aufgetreten."
#: allianceauth/groupmanagement/views.py:298
#: allianceauth/groupmanagement/views.py:296
#, python-format
msgid "Rejected application from %(mainchar)s to leave %(group)s."
msgstr "Austrittsgesuch von %(mainchar)s für Gruppe %(group)s abgelehnt."
#: allianceauth/groupmanagement/views.py:345
#: allianceauth/groupmanagement/views.py:342
#: allianceauth/groupmanagement/views.py:354
msgid "You cannot join that group"
msgstr "Du kannst dieser Gruppe nicht beitreten"
#: allianceauth/groupmanagement/views.py:369
#: allianceauth/groupmanagement/views.py:407
#: allianceauth/groupmanagement/views.py:348
msgid "You are already a member of that group."
msgstr "Du bist bereits Mitglied dieser Gruppe."
#: allianceauth/groupmanagement/views.py:363
msgid "You already have a pending application for that group."
msgstr "Du hast Dich bereits für diese Gruppe beworben."
#: allianceauth/groupmanagement/views.py:366
#: allianceauth/groupmanagement/views.py:404
#: allianceauth/hrapplications/templates/hrapplications/management.html:37
#: allianceauth/hrapplications/templates/hrapplications/management.html:72
#: allianceauth/hrapplications/templates/hrapplications/management.html:99
#: allianceauth/hrapplications/templates/hrapplications/management.html:144
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:38
#: allianceauth/hrapplications/templates/hrapplications/view.html:20
#: allianceauth/srp/templates/srp/data.html:125
#: allianceauth/srp/templates/srp/data.html:134
#: allianceauth/srp/templates/srp/management.html:81
msgid "Pending"
msgstr "Beantragt"
#: allianceauth/groupmanagement/views.py:375
#: allianceauth/groupmanagement/views.py:372
#, python-format
msgid "Applied to group %(group)s."
msgstr "Beitritt zur Gruppe %(group)s beantragt."
#: allianceauth/groupmanagement/views.py:386
#: allianceauth/groupmanagement/views.py:383
msgid "You cannot leave that group"
msgstr "Du kannst diese Gruppe nicht verlassen"
#: allianceauth/groupmanagement/views.py:391
#: allianceauth/groupmanagement/views.py:388
msgid "You are not a member of that group"
msgstr "Du bist kein Mitglied dieser Gruppe"
#: allianceauth/groupmanagement/views.py:413
#: allianceauth/groupmanagement/views.py:397
msgid "You already have a pending leave request for that group."
msgstr "Du hast bereits ein ausstehendes Austrittsgesuch für diese Gruppe."
#: allianceauth/groupmanagement/views.py:410
#, python-format
msgid "Applied to leave group %(group)s."
msgstr "Austrittsgesuch für Gruppe %(group)s gesendet."
#: allianceauth/hrapplications/auth_hooks.py:10
#: allianceauth/hrapplications/auth_hooks.py:13
msgid "Applications"
msgstr "Bewerbungen"
@@ -863,7 +909,7 @@ msgstr "Benutzername"
#: allianceauth/hrapplications/templates/hrapplications/management.html:131
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:28
#: allianceauth/hrapplications/templates/hrapplications/view.html:75
#: allianceauth/srp/templates/srp/data.html:99
#: allianceauth/srp/templates/srp/data.html:100
#: allianceauth/srp/templates/srp/management.html:46
msgid "Actions"
msgstr "Aktionen"
@@ -873,7 +919,7 @@ msgstr "Aktionen"
#: allianceauth/hrapplications/templates/hrapplications/management.html:147
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:40
#: allianceauth/hrapplications/templates/hrapplications/view.html:16
#: allianceauth/srp/templates/srp/data.html:117
#: allianceauth/srp/templates/srp/data.html:126
msgid "Approved"
msgstr "Akzeptiert"
@@ -881,7 +927,7 @@ msgstr "Akzeptiert"
#: allianceauth/hrapplications/templates/hrapplications/management.html:104
#: allianceauth/hrapplications/templates/hrapplications/management.html:149
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:42
#: allianceauth/srp/templates/srp/data.html:121
#: allianceauth/srp/templates/srp/data.html:130
msgid "Rejected"
msgstr "Abgelehnt"
@@ -987,7 +1033,7 @@ msgstr "Ungelesen"
#: allianceauth/notifications/templates/notifications/list.html:18
msgid "Read"
msgstr "Lesen"
msgstr "Gelesen"
#: allianceauth/notifications/templates/notifications/list.html:22
msgid "Mark All Read"
@@ -1145,11 +1191,7 @@ msgstr "Änderungen für Operation timer %(opname)s gespeichert."
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:6
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:10
msgid "Permissions Audit"
msgstr "Berechtigungsprüfung"
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr "Zurück"
msgstr "Berechtigungsübersicht"
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:22
msgid "User / Character"
@@ -1196,6 +1238,18 @@ msgstr "Nutzer"
msgid "States"
msgstr "Status"
#: allianceauth/services/abstract.py:72
msgid "That service account already exists"
msgstr "Dieses Dienstkonto existiert bereits"
#: allianceauth/services/abstract.py:104
msgid "Successfully set your {} password"
msgstr "Dein {} Passwort wurde erfolgreich gesetzt"
#: allianceauth/services/auth_hooks.py:11
msgid "Services"
msgstr "Dienste"
#: allianceauth/services/forms.py:6
msgid "Name of Fleet:"
msgstr "SRP Flotte erstellen:"
@@ -1256,19 +1310,120 @@ msgstr "Passwort"
msgid "Password must be at least 8 characters long."
msgstr "Passwort muss mindestens 8 Zeichen lang sein"
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:23
#: allianceauth/services/modules/discord/models.py:225
msgid "Discord Account Disabled"
msgstr "Discord Konto deaktiviert"
#: allianceauth/services/modules/discord/models.py:227
msgid ""
"Your Discord account was disabeled automatically by Auth. If you think this "
"was a mistake, please contact an admin."
msgstr ""
"Dein Discord Konto wurde automatisch durch Auth deaktiviert. Wenn Du glaubst"
" dies war ein Fehler, kontaktiere bitte einen Administrator."
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:18
msgid "Join the Discord server"
msgstr "Discord Server beitreten"
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:22
msgid "Leave- and rejoin the Discord Server (Reset)"
msgstr "Discord Server verlassen und wieder beitreten (Zurücksetzen)"
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:25
msgid "Leave the Discord server"
msgstr "Discord Server verlassen"
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:32
msgid "Link Discord Server"
msgstr "Verbinde Discord Server"
#: allianceauth/services/modules/openfire/forms.py:7
msgid "Message"
msgstr "Nachricht"
#: allianceauth/services/modules/discord/views.py:30
msgid "Deactivated Discord account."
msgstr "Discord Konto deaktiviert."
#: allianceauth/services/modules/discord/views.py:36
#: allianceauth/services/modules/discord/views.py:59
msgid "An error occurred while processing your Discord account."
msgstr "Es gab einen Fehler bei der Verarbeitung Deines Discord Kontos."
#: allianceauth/services/modules/discord/views.py:102
msgid "Your Discord account has been successfully activated."
msgstr "Dein Discord Konto wurde erfolgreich aktiviert."
#: allianceauth/services/modules/discord/views.py:108
msgid ""
"An error occurred while trying to activate your Discord account. Please try "
"again."
msgstr ""
"Es gab einen Fehler während der Aktivierung Deines Discord Kontos. Bitte "
"versuche es noch einmal."
#: allianceauth/services/modules/discourse/views.py:37
msgid "You are not authorized to access Discourse."
msgstr "Du bist nicht autorisiert auf Discorse zuzugreifen."
#: allianceauth/services/modules/discourse/views.py:42
msgid "You must have a main character set to access Discourse."
msgstr ""
"Du musst einen Hauptcharakter gesetzt haben um auf Discourse zuzugreifen."
#: allianceauth/services/modules/discourse/views.py:52
msgid ""
"No SSO payload or signature. Please contact support if this problem "
"persists."
msgstr ""
"Keine SSO-Nutzdaten oder Signaturen. Bitte wenden Sie sich an den Support, "
"wenn das Problem weiterhin besteht."
#: allianceauth/services/modules/discourse/views.py:62
#: allianceauth/services/modules/discourse/views.py:70
msgid "Invalid payload. Please contact support if this problem persists."
msgstr ""
"Ungültige Nutzdaten. Bitte wenden Sie sich an den Support, wenn das Problem "
"weiterhin besteht."
#: allianceauth/services/modules/ips4/views.py:31
msgid "Activated IPSuite4 account."
msgstr "IP4Suite Konto aktiviert."
#: allianceauth/services/modules/ips4/views.py:40
#: allianceauth/services/modules/ips4/views.py:62
#: allianceauth/services/modules/ips4/views.py:83
#: allianceauth/services/modules/ips4/views.py:103
msgid "An error occurred while processing your IPSuite4 account."
msgstr "Es gab einen Fehler bei der Verarbeitung Deines IPSuite4 Kontos."
#: allianceauth/services/modules/ips4/views.py:53
msgid "Reset IPSuite4 password."
msgstr "IPSuite4 Passwort zurücksetzen."
#: allianceauth/services/modules/ips4/views.py:80
msgid "Set IPSuite4 password."
msgstr "Setze IPSuite4 Passwort."
#: allianceauth/services/modules/ips4/views.py:100
msgid "Deactivated IPSuite4 account."
msgstr "IP4Suite Konto deaktiviert."
#: allianceauth/services/modules/openfire/auth_hooks.py:26
msgid "Jabber"
msgstr "Jabber"
#: allianceauth/services/modules/openfire/auth_hooks.py:78
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:6
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:11
msgid "Jabber Broadcast"
msgstr "Jabber Übertragung"
#: allianceauth/services/modules/openfire/auth_hooks.py:91
msgid "Fleet Broadcast Formatter"
msgstr "Flotten Ping Formatierung"
#: allianceauth/services/modules/openfire/forms.py:7
msgid "Message"
msgstr "Nachricht"
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:17
msgid "Broadcast Sent!!"
msgstr "Übertragung gesendet!!"
@@ -1277,6 +1432,76 @@ msgstr "Übertragung gesendet!!"
msgid "Broadcast"
msgstr "Übertragungen"
#: allianceauth/services/modules/openfire/views.py:35
msgid "Activated jabber account."
msgstr "Jabber Konto aktiviert."
#: allianceauth/services/modules/openfire/views.py:44
#: allianceauth/services/modules/openfire/views.py:57
#: allianceauth/services/modules/openfire/views.py:78
#: allianceauth/services/modules/openfire/views.py:151
msgid "An error occurred while processing your jabber account."
msgstr "Es gab einen Fehler bei der Verarbeitung Deines Jabber Kontos."
#: allianceauth/services/modules/openfire/views.py:70
msgid "Reset jabber password."
msgstr "Jabber Passwort zurücksetzen."
#: allianceauth/services/modules/openfire/views.py:119
#, python-format
msgid "Sent jabber broadcast to %s"
msgstr "Sende Jabber Durchsage an %s"
#: allianceauth/services/modules/openfire/views.py:148
msgid "Set jabber password."
msgstr "Setze Jabber Passwort."
#: allianceauth/services/modules/phpbb3/views.py:34
msgid "Activated forum account."
msgstr "Forum Konto aktiviert."
#: allianceauth/services/modules/phpbb3/views.py:43
#: allianceauth/services/modules/phpbb3/views.py:57
#: allianceauth/services/modules/phpbb3/views.py:80
#: allianceauth/services/modules/phpbb3/views.py:103
msgid "An error occurred while processing your forum account."
msgstr "Es gab einen Fehler bei der Verarbeitung Deines Forum Kontos."
#: allianceauth/services/modules/phpbb3/views.py:54
msgid "Deactivated forum account."
msgstr "Forum Konto deaktiviert."
#: allianceauth/services/modules/phpbb3/views.py:71
msgid "Reset forum password."
msgstr "Forum Passwort zurücksetzen."
#: allianceauth/services/modules/phpbb3/views.py:100
msgid "Set forum password."
msgstr "Setze Forum Passwort."
#: allianceauth/services/modules/smf/views.py:34
msgid "Activated SMF account."
msgstr "SMF Konto aktiviert."
#: allianceauth/services/modules/smf/views.py:43
#: allianceauth/services/modules/smf/views.py:58
#: allianceauth/services/modules/smf/views.py:80
#: allianceauth/services/modules/smf/views.py:103
msgid "An error occurred while processing your SMF account."
msgstr "Es gab einen Fehler bei der Verarbeitung Deines SMF Kontos."
#: allianceauth/services/modules/smf/views.py:55
msgid "Deactivated SMF account."
msgstr "SMF Konto deaktiviert."
#: allianceauth/services/modules/smf/views.py:72
msgid "Reset SMF password."
msgstr "SMF Passwort zurücksetzen."
#: allianceauth/services/modules/smf/views.py:100
msgid "Set SMF password."
msgstr "Setze SMF Passwort."
#: allianceauth/services/modules/teamspeak3/forms.py:14
#, python-format
msgid "Unable to locate user %s on server"
@@ -1300,6 +1525,47 @@ msgstr "Server beitreten"
msgid "Continue"
msgstr "Fortsetzen"
#: allianceauth/services/modules/teamspeak3/views.py:34
msgid "Activated TeamSpeak3 account."
msgstr "TeamSpeak3 Konto aktiviert."
#: allianceauth/services/modules/teamspeak3/views.py:37
#: allianceauth/services/modules/teamspeak3/views.py:74
#: allianceauth/services/modules/teamspeak3/views.py:100
msgid "An error occurred while processing your TeamSpeak3 account."
msgstr "Es gab einen Fehler bei der Verarbeitung Deines TeamSpeak3 Kontos."
#: allianceauth/services/modules/teamspeak3/views.py:71
msgid "Deactivated TeamSpeak3 account."
msgstr "TeamSpeak3 Konto deaktiviert."
#: allianceauth/services/modules/teamspeak3/views.py:97
msgid "Reset TeamSpeak3 permission key."
msgstr "TeamSpeak3 Berechtigungsschlüssel zurücksetzen."
#: allianceauth/services/modules/xenforo/views.py:30
msgid "Activated XenForo account."
msgstr "XenForo Konto aktiviert."
#: allianceauth/services/modules/xenforo/views.py:40
#: allianceauth/services/modules/xenforo/views.py:52
#: allianceauth/services/modules/xenforo/views.py:73
#: allianceauth/services/modules/xenforo/views.py:94
msgid "An error occurred while processing your XenForo account."
msgstr "Es gab einen Fehler bei der Verarbeitung Deines XenForo Kontos."
#: allianceauth/services/modules/xenforo/views.py:50
msgid "Deactivated XenForo account."
msgstr "XenForo Konto deaktiviert."
#: allianceauth/services/modules/xenforo/views.py:65
msgid "Reset XenForo account password."
msgstr "XenForo Passwort zurüclsetzen."
#: allianceauth/services/modules/xenforo/views.py:91
msgid "Changed XenForo password."
msgstr "Setze XenForo Passwort."
#: allianceauth/services/templates/services/fleetformattertool.html:6
msgid "Fleet Formatter Tool"
msgstr "Flottenformatierung"
@@ -1362,7 +1628,7 @@ msgstr "Dienst"
msgid "Domain"
msgstr "Domain"
#: allianceauth/srp/auth_hooks.py:9
#: allianceauth/srp/auth_hooks.py:12
msgid "Ship Replacement"
msgstr "Schiffserstattung"
@@ -1376,7 +1642,7 @@ msgstr "Flottenzeit"
msgid "Fleet Doctrine"
msgstr "Flottendoktrin"
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:89
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:90
msgid "Additional Info"
msgstr "Zusätzliche Info"
@@ -1405,65 +1671,65 @@ msgstr "SRP-Flotte erstellen"
msgid "Give this link to the line members"
msgstr "Gib diesen Link an Deine Piloten weiter"
#: allianceauth/srp/templates/srp/data.html:48
#: allianceauth/srp/templates/srp/data.html:49
msgid "SRP Fleet Data"
msgstr "SRP-Flotte Daten"
#: allianceauth/srp/templates/srp/data.html:53
#: allianceauth/srp/templates/srp/data.html:54
msgid "Mark Incomplete"
msgstr "Als unvollständig markieren"
#: allianceauth/srp/templates/srp/data.html:57
#: allianceauth/srp/templates/srp/data.html:58
msgid "Mark Completed"
msgstr "Als vollständig markieren"
#: allianceauth/srp/templates/srp/data.html:69
#: allianceauth/srp/templates/srp/data.html:145
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:156
msgid "Total Losses:"
msgstr "Verluste insgesamt:"
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:146
#: allianceauth/srp/templates/srp/data.html:71
#: allianceauth/srp/templates/srp/data.html:157
#: allianceauth/srp/templates/srp/management.html:30
msgid "Total ISK Cost:"
msgstr "ISK-Kosten insgesamt:"
#: allianceauth/srp/templates/srp/data.html:78
#: allianceauth/srp/templates/srp/data.html:154
#: allianceauth/srp/templates/srp/data.html:79
#: allianceauth/srp/templates/srp/data.html:165
msgid "Are you sure you want to delete SRP requests?"
msgstr "Bist Du sicher das Du SRP Anfragen löschen willst?"
#: allianceauth/srp/templates/srp/data.html:87
#: allianceauth/srp/templates/srp/data.html:88
msgid "Pilot Name"
msgstr "Name des Piloten"
#: allianceauth/srp/templates/srp/data.html:88
#: allianceauth/srp/templates/srp/data.html:89
msgid "Killboard Link"
msgstr "Killboard Link"
#: allianceauth/srp/templates/srp/data.html:90
#: allianceauth/srp/templates/srp/data.html:91
msgid "Ship Type"
msgstr "Schiffstyp"
#: allianceauth/srp/templates/srp/data.html:91
#: allianceauth/srp/templates/srp/data.html:92
msgid "Killboard Loss Amt"
msgstr "Summe Killboard Verluste"
#: allianceauth/srp/templates/srp/data.html:92
#: allianceauth/srp/templates/srp/data.html:93
msgid "SRP ISK Cost"
msgstr "SRP ISK-Kosten"
#: allianceauth/srp/templates/srp/data.html:93
#: allianceauth/srp/templates/srp/data.html:94
msgid "Click value to edit Enter to save & next ESC to cancel"
msgstr ""
"Klicke auf den Wert um diesen zu bearbeiten, Enter zum Speichern und um zum "
"nächsten Wert zu springen, ESC zum Beenden."
#: allianceauth/srp/templates/srp/data.html:96
#: allianceauth/srp/templates/srp/data.html:97
msgid "Post Time"
msgstr "Veröffentlichungszeit"
#: allianceauth/srp/templates/srp/data.html:163
#: allianceauth/srp/templates/srp/data.html:174
msgid "No SRP requests for this fleet."
msgstr "Keine SRP Anfragen für diese Flotte."
@@ -1659,44 +1925,36 @@ msgid "Current"
msgstr "Aktuell"
#: allianceauth/templates/allianceauth/admin-status/overview.html:40
msgid "Latest Major"
msgstr "Aktuellste Hauptversion"
msgid "Latest Stable"
msgstr "Aktuellste stabile Version"
#: allianceauth/templates/allianceauth/admin-status/overview.html:46
#: allianceauth/templates/allianceauth/admin-status/overview.html:56
#: allianceauth/templates/allianceauth/admin-status/overview.html:66
msgid "Update available"
msgstr "Update verfügbar"
#: allianceauth/templates/allianceauth/admin-status/overview.html:50
msgid "Latest Minor"
msgstr "Aktuellste Unterversion"
#: allianceauth/templates/allianceauth/admin-status/overview.html:51
msgid "Latest Pre-Release"
msgstr "Aktuellste Testversion"
#: allianceauth/templates/allianceauth/admin-status/overview.html:60
msgid "Latest Patch"
msgstr "Aktuellste Patchversion"
#: allianceauth/templates/allianceauth/admin-status/overview.html:57
msgid "Pre-Release available"
msgstr "Testversion verfügbar"
#: allianceauth/templates/allianceauth/admin-status/overview.html:73
#: allianceauth/templates/allianceauth/admin-status/overview.html:65
msgid "Task Queue"
msgstr "Warteschlange"
#: allianceauth/templates/allianceauth/admin-status/overview.html:90
#: allianceauth/templates/allianceauth/admin-status/overview.html:82
msgid "Error retrieving task queue length"
msgstr "Fehler beim Ermitteln der Warteschlange."
#: allianceauth/templates/allianceauth/admin-status/overview.html:92
#: allianceauth/templates/allianceauth/admin-status/overview.html:84
#, python-format
msgid "%(tasks)s task"
msgid_plural "%(tasks)s tasks"
msgstr[0] "%(tasks)sAufgabe"
msgstr[1] "%(tasks)sAufgaben"
#: allianceauth/templates/allianceauth/help.html:4
#: allianceauth/templates/allianceauth/help.html:9
#: allianceauth/templates/allianceauth/side-menu.html:34
msgid "Help"
msgstr "Hilfe"
#: allianceauth/templates/allianceauth/night-toggle.html:3
msgid "Night"
msgstr "Nacht"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-09 15:16+0000\n"
"POT-Creation-Date: 2020-10-01 02:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -22,61 +22,57 @@ msgstr ""
msgid "A main character is required to perform that action. Add one below."
msgstr ""
#: allianceauth/authentication/forms.py:6
#: allianceauth/authentication/forms.py:5
msgid "Email"
msgstr ""
#: allianceauth/authentication/models.py:76
msgid "State Changed"
#: allianceauth/authentication/models.py:78
#, python-format
msgid "State changed to: %s"
msgstr ""
#: allianceauth/authentication/models.py:77
#: allianceauth/authentication/models.py:79
#, python-format
msgid "Your user state has been changed to %(state)s"
msgid "Your user's state is now: %(state)s"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:5
#: allianceauth/authentication/templates/authentication/dashboard.html:8
#: allianceauth/templates/allianceauth/side-menu.html:10
#: allianceauth/templates/allianceauth/side-menu.html:11
msgid "Dashboard"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:17
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
#: allianceauth/authentication/templates/authentication/dashboard.html:18
#, python-format
msgid ""
"\n"
" Main Character (State: %(state)s)\n"
" "
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:77
#: allianceauth/authentication/templates/authentication/dashboard.html:81
msgid "No main character set."
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:84
#: allianceauth/authentication/templates/authentication/dashboard.html:88
msgid "Add Character"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:88
#: allianceauth/authentication/templates/authentication/dashboard.html:92
msgid "Change Main"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:97
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:15
msgid "Groups"
#: allianceauth/authentication/templates/authentication/dashboard.html:101
msgid "Group Memberships"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:117
#: allianceauth/authentication/templates/authentication/dashboard.html:121
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:41
msgid "Characters"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:125
#: allianceauth/authentication/templates/authentication/dashboard.html:129
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:73
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:22
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:15
@@ -85,13 +81,13 @@ msgstr ""
msgid "Name"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:126
#: allianceauth/authentication/templates/authentication/dashboard.html:130
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticsview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:46
msgid "Corp"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:127
#: allianceauth/authentication/templates/authentication/dashboard.html:131
#: allianceauth/corputils/templates/corputils/corpstats.html:77
#: allianceauth/hrapplications/templates/hrapplications/view.html:47
msgid "Alliance"
@@ -132,41 +128,48 @@ msgstr ""
msgid "Submit"
msgstr ""
#: allianceauth/authentication/views.py:39
#: allianceauth/authentication/views.py:74
#, python-format
msgid ""
"Cannot change main character to %(char)s: character owned by a different "
"account."
msgstr ""
#: allianceauth/authentication/views.py:80
#, python-format
msgid "Changed main character to %(char)s"
msgstr ""
#: allianceauth/authentication/views.py:48
#: allianceauth/authentication/views.py:89
#, python-format
msgid "Added %(name)s to your account."
msgstr ""
#: allianceauth/authentication/views.py:50
#: allianceauth/authentication/views.py:91
#, python-format
msgid "Failed to add %(name)s to your account: they already have an account."
msgstr ""
#: allianceauth/authentication/views.py:89
#: allianceauth/authentication/views.py:130
msgid "Unable to authenticate as the selected character."
msgstr ""
#: allianceauth/authentication/views.py:107
#: allianceauth/authentication/views.py:146
msgid "Registration token has expired."
msgstr ""
#: allianceauth/authentication/views.py:159
#: allianceauth/authentication/views.py:201
msgid ""
"Sent confirmation email. Please follow the link to confirm your email "
"address."
msgstr ""
#: allianceauth/authentication/views.py:164
#: allianceauth/authentication/views.py:206
msgid "Confirmed your email address. Please login to continue."
msgstr ""
#: allianceauth/authentication/views.py:169
msgid "Registraion of new accounts it not allowed at this time."
#: allianceauth/authentication/views.py:211
msgid "Registration of new accounts is not allowed at this time."
msgstr ""
#: allianceauth/corputils/auth_hooks.py:10
@@ -216,8 +219,8 @@ msgstr ""
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:28
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:27
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:29
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:37
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:96
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:51
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:110
msgid "Character"
msgstr ""
@@ -239,6 +242,16 @@ msgstr ""
msgid "Killboard"
msgstr ""
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
msgstr ""
#: allianceauth/corputils/templates/corputils/corpstats.html:117
#: allianceauth/corputils/templates/corputils/search.html:17
msgid "Main Corporation"
@@ -522,11 +535,22 @@ msgstr ""
msgid "FAT link has expired."
msgstr ""
#: allianceauth/groupmanagement/auth_hooks.py:16
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
msgid "Group Management"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:5
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:13
msgid "Audit Log"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:18
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:20
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:25
msgid "Date/Time"
msgstr ""
@@ -568,8 +592,8 @@ msgid "Portrait"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:30
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:38
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:52
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:111
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:23
msgid "Organization"
msgstr ""
@@ -586,6 +610,12 @@ msgstr ""
msgid "Groups Membership"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:14
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:16
msgid "Groups"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:16
msgid "Description"
@@ -596,7 +626,7 @@ msgstr ""
#: allianceauth/hrapplications/templates/hrapplications/management.html:85
#: allianceauth/hrapplications/templates/hrapplications/management.html:130
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:27
#: allianceauth/srp/templates/srp/data.html:97
#: allianceauth/srp/templates/srp/data.html:98
msgid "Status"
msgstr ""
@@ -625,7 +655,11 @@ msgstr ""
msgid "Audit Members"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:64
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:56
msgid "Copy Direct Join Link"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:68
msgid "No groups to list."
msgstr ""
@@ -654,37 +688,37 @@ msgstr ""
msgid "Groups Management"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:25
msgid "Join Requests"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:24
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:33
msgid "Leave Requests"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:39
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:98
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:53
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:112
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:20
#: allianceauth/services/modules/openfire/forms.py:6
msgid "Group"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:71
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:130
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:85
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:144
msgid "Accept"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:74
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:133
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:88
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:147
#: allianceauth/hrapplications/templates/hrapplications/view.html:85
msgid "Reject"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:83
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
msgid "No group add requests."
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:142
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:156
msgid "No group leave requests."
msgstr ""
@@ -692,11 +726,6 @@ msgstr ""
msgid "Toggle navigation"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
#: allianceauth/templates/allianceauth/side-menu.html:23
msgid "Group Management"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:21
msgid "Group Requests"
msgstr ""
@@ -705,91 +734,104 @@ msgstr ""
msgid "Group Membership"
msgstr ""
#: allianceauth/groupmanagement/views.py:164
#: allianceauth/groupmanagement/views.py:162
#, python-format
msgid "Removed user %(user)s from group %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:166
#: allianceauth/groupmanagement/views.py:164
msgid "User does not exist in that group"
msgstr ""
#: allianceauth/groupmanagement/views.py:169
#: allianceauth/groupmanagement/views.py:167
msgid "Group does not exist"
msgstr ""
#: allianceauth/groupmanagement/views.py:196
#: allianceauth/groupmanagement/views.py:194
#, python-format
msgid "Accepted application from %(mainchar)s to %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:203
#: allianceauth/groupmanagement/views.py:236
#: allianceauth/groupmanagement/views.py:201
#: allianceauth/groupmanagement/views.py:234
#, python-format
msgid ""
"An unhandled error occurred while processing the application from "
"%(mainchar)s to %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:229
#: allianceauth/groupmanagement/views.py:227
#, python-format
msgid "Rejected application from %(mainchar)s to %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:265
#: allianceauth/groupmanagement/views.py:263
#, python-format
msgid "Accepted application from %(mainchar)s to leave %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:271
#: allianceauth/groupmanagement/views.py:305
#: allianceauth/groupmanagement/views.py:269
#: allianceauth/groupmanagement/views.py:303
#, python-format
msgid ""
"An unhandled error occured while processing the application from "
"An unhandled error occurred while processing the application from "
"%(mainchar)s to leave %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:298
#: allianceauth/groupmanagement/views.py:296
#, python-format
msgid "Rejected application from %(mainchar)s to leave %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:345
#: allianceauth/groupmanagement/views.py:342
#: allianceauth/groupmanagement/views.py:354
msgid "You cannot join that group"
msgstr ""
#: allianceauth/groupmanagement/views.py:369
#: allianceauth/groupmanagement/views.py:407
#: allianceauth/groupmanagement/views.py:348
msgid "You are already a member of that group."
msgstr ""
#: allianceauth/groupmanagement/views.py:363
msgid "You already have a pending application for that group."
msgstr ""
#: allianceauth/groupmanagement/views.py:366
#: allianceauth/groupmanagement/views.py:404
#: allianceauth/hrapplications/templates/hrapplications/management.html:37
#: allianceauth/hrapplications/templates/hrapplications/management.html:72
#: allianceauth/hrapplications/templates/hrapplications/management.html:99
#: allianceauth/hrapplications/templates/hrapplications/management.html:144
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:38
#: allianceauth/hrapplications/templates/hrapplications/view.html:20
#: allianceauth/srp/templates/srp/data.html:125
#: allianceauth/srp/templates/srp/data.html:128
#: allianceauth/srp/templates/srp/management.html:81
msgid "Pending"
msgstr ""
#: allianceauth/groupmanagement/views.py:375
#: allianceauth/groupmanagement/views.py:372
#, python-format
msgid "Applied to group %(group)s."
msgstr ""
#: allianceauth/groupmanagement/views.py:386
#: allianceauth/groupmanagement/views.py:383
msgid "You cannot leave that group"
msgstr ""
#: allianceauth/groupmanagement/views.py:391
#: allianceauth/groupmanagement/views.py:388
msgid "You are not a member of that group"
msgstr ""
#: allianceauth/groupmanagement/views.py:413
#: allianceauth/groupmanagement/views.py:397
msgid "You already have a pending leave request for that group."
msgstr ""
#: allianceauth/groupmanagement/views.py:410
#, python-format
msgid "Applied to leave group %(group)s."
msgstr ""
#: allianceauth/hrapplications/auth_hooks.py:10
#: allianceauth/hrapplications/auth_hooks.py:13
msgid "Applications"
msgstr ""
@@ -846,7 +888,7 @@ msgstr ""
#: allianceauth/hrapplications/templates/hrapplications/management.html:131
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:28
#: allianceauth/hrapplications/templates/hrapplications/view.html:75
#: allianceauth/srp/templates/srp/data.html:99
#: allianceauth/srp/templates/srp/data.html:100
#: allianceauth/srp/templates/srp/management.html:46
msgid "Actions"
msgstr ""
@@ -856,7 +898,7 @@ msgstr ""
#: allianceauth/hrapplications/templates/hrapplications/management.html:147
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:40
#: allianceauth/hrapplications/templates/hrapplications/view.html:16
#: allianceauth/srp/templates/srp/data.html:117
#: allianceauth/srp/templates/srp/data.html:120
msgid "Approved"
msgstr ""
@@ -864,7 +906,7 @@ msgstr ""
#: allianceauth/hrapplications/templates/hrapplications/management.html:104
#: allianceauth/hrapplications/templates/hrapplications/management.html:149
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:42
#: allianceauth/srp/templates/srp/data.html:121
#: allianceauth/srp/templates/srp/data.html:124
msgid "Rejected"
msgstr ""
@@ -1130,10 +1172,6 @@ msgstr ""
msgid "Permissions Audit"
msgstr ""
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr ""
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:22
msgid "User / Character"
msgstr ""
@@ -1179,6 +1217,18 @@ msgstr ""
msgid "States"
msgstr ""
#: allianceauth/services/abstract.py:72
msgid "That service account already exists"
msgstr ""
#: allianceauth/services/abstract.py:104
msgid "Successfully set your {} password"
msgstr ""
#: allianceauth/services/auth_hooks.py:11
msgid "Services"
msgstr ""
#: allianceauth/services/forms.py:6
msgid "Name of Fleet:"
msgstr ""
@@ -1239,19 +1289,110 @@ msgstr ""
msgid "Password must be at least 8 characters long."
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:23
#: allianceauth/services/modules/discord/models.py:225
msgid "Discord Account Disabled"
msgstr ""
#: allianceauth/services/modules/discord/models.py:227
msgid ""
"Your Discord account was disabled automatically by Auth. If you think this "
"was a mistake, please contact an admin."
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:18
msgid "Join the Discord server"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:22
msgid "Leave- and rejoin the Discord Server (Reset)"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:25
msgid "Leave the Discord server"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:32
msgid "Link Discord Server"
msgstr ""
#: allianceauth/services/modules/discord/views.py:30
msgid "Deactivated Discord account."
msgstr ""
#: allianceauth/services/modules/discord/views.py:36
#: allianceauth/services/modules/discord/views.py:59
msgid "An error occurred while processing your Discord account."
msgstr ""
#: allianceauth/services/modules/discord/views.py:102
msgid "Your Discord account has been successfully activated."
msgstr ""
#: allianceauth/services/modules/discord/views.py:108
msgid ""
"An error occurred while trying to activate your Discord account. Please try "
"again."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:37
msgid "You are not authorized to access Discourse."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:42
msgid "You must have a main character set to access Discourse."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:52
msgid ""
"No SSO payload or signature. Please contact support if this problem persists."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:62
#: allianceauth/services/modules/discourse/views.py:70
msgid "Invalid payload. Please contact support if this problem persists."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:31
msgid "Activated IPSuite4 account."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:40
#: allianceauth/services/modules/ips4/views.py:62
#: allianceauth/services/modules/ips4/views.py:83
#: allianceauth/services/modules/ips4/views.py:103
msgid "An error occurred while processing your IPSuite4 account."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:53
msgid "Reset IPSuite4 password."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:80
msgid "Set IPSuite4 password."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:100
msgid "Deactivated IPSuite4 account."
msgstr ""
#: allianceauth/services/modules/openfire/auth_hooks.py:26
msgid "Jabber"
msgstr ""
#: allianceauth/services/modules/openfire/auth_hooks.py:78
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:6
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:11
msgid "Jabber Broadcast"
msgstr ""
#: allianceauth/services/modules/openfire/auth_hooks.py:91
msgid "Fleet Broadcast Formatter"
msgstr ""
#: allianceauth/services/modules/openfire/forms.py:7
msgid "Message"
msgstr ""
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:6
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:11
msgid "Jabber Broadcast"
msgstr ""
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:17
msgid "Broadcast Sent!!"
msgstr ""
@@ -1260,6 +1401,76 @@ msgstr ""
msgid "Broadcast"
msgstr ""
#: allianceauth/services/modules/openfire/views.py:35
msgid "Activated jabber account."
msgstr ""
#: allianceauth/services/modules/openfire/views.py:44
#: allianceauth/services/modules/openfire/views.py:57
#: allianceauth/services/modules/openfire/views.py:78
#: allianceauth/services/modules/openfire/views.py:151
msgid "An error occurred while processing your jabber account."
msgstr ""
#: allianceauth/services/modules/openfire/views.py:70
msgid "Reset jabber password."
msgstr ""
#: allianceauth/services/modules/openfire/views.py:119
#, python-format
msgid "Sent jabber broadcast to %s"
msgstr ""
#: allianceauth/services/modules/openfire/views.py:148
msgid "Set jabber password."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:34
msgid "Activated forum account."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:43
#: allianceauth/services/modules/phpbb3/views.py:57
#: allianceauth/services/modules/phpbb3/views.py:80
#: allianceauth/services/modules/phpbb3/views.py:103
msgid "An error occurred while processing your forum account."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:54
msgid "Deactivated forum account."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:71
msgid "Reset forum password."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:100
msgid "Set forum password."
msgstr ""
#: allianceauth/services/modules/smf/views.py:34
msgid "Activated SMF account."
msgstr ""
#: allianceauth/services/modules/smf/views.py:43
#: allianceauth/services/modules/smf/views.py:58
#: allianceauth/services/modules/smf/views.py:80
#: allianceauth/services/modules/smf/views.py:103
msgid "An error occurred while processing your SMF account."
msgstr ""
#: allianceauth/services/modules/smf/views.py:55
msgid "Deactivated SMF account."
msgstr ""
#: allianceauth/services/modules/smf/views.py:72
msgid "Reset SMF password."
msgstr ""
#: allianceauth/services/modules/smf/views.py:100
msgid "Set SMF password."
msgstr ""
#: allianceauth/services/modules/teamspeak3/forms.py:14
#, python-format
msgid "Unable to locate user %s on server"
@@ -1283,6 +1494,47 @@ msgstr ""
msgid "Continue"
msgstr ""
#: allianceauth/services/modules/teamspeak3/views.py:34
msgid "Activated TeamSpeak3 account."
msgstr ""
#: allianceauth/services/modules/teamspeak3/views.py:37
#: allianceauth/services/modules/teamspeak3/views.py:74
#: allianceauth/services/modules/teamspeak3/views.py:100
msgid "An error occurred while processing your TeamSpeak3 account."
msgstr ""
#: allianceauth/services/modules/teamspeak3/views.py:71
msgid "Deactivated TeamSpeak3 account."
msgstr ""
#: allianceauth/services/modules/teamspeak3/views.py:97
msgid "Reset TeamSpeak3 permission key."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:30
msgid "Activated XenForo account."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:40
#: allianceauth/services/modules/xenforo/views.py:52
#: allianceauth/services/modules/xenforo/views.py:73
#: allianceauth/services/modules/xenforo/views.py:94
msgid "An error occurred while processing your XenForo account."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:50
msgid "Deactivated XenForo account."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:65
msgid "Reset XenForo account password."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:91
msgid "Changed XenForo password."
msgstr ""
#: allianceauth/services/templates/services/fleetformattertool.html:6
msgid "Fleet Formatter Tool"
msgstr ""
@@ -1343,7 +1595,7 @@ msgstr ""
msgid "Domain"
msgstr ""
#: allianceauth/srp/auth_hooks.py:9
#: allianceauth/srp/auth_hooks.py:12
msgid "Ship Replacement"
msgstr ""
@@ -1355,7 +1607,7 @@ msgstr ""
msgid "Fleet Doctrine"
msgstr ""
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:89
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:90
msgid "Additional Info"
msgstr ""
@@ -1384,63 +1636,63 @@ msgstr ""
msgid "Give this link to the line members"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:48
#: allianceauth/srp/templates/srp/data.html:49
msgid "SRP Fleet Data"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:53
#: allianceauth/srp/templates/srp/data.html:54
msgid "Mark Incomplete"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:57
#: allianceauth/srp/templates/srp/data.html:58
msgid "Mark Completed"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:69
#: allianceauth/srp/templates/srp/data.html:145
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:150
msgid "Total Losses:"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:146
#: allianceauth/srp/templates/srp/data.html:71
#: allianceauth/srp/templates/srp/data.html:151
#: allianceauth/srp/templates/srp/management.html:30
msgid "Total ISK Cost:"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:78
#: allianceauth/srp/templates/srp/data.html:154
#: allianceauth/srp/templates/srp/data.html:79
#: allianceauth/srp/templates/srp/data.html:159
msgid "Are you sure you want to delete SRP requests?"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:87
#: allianceauth/srp/templates/srp/data.html:88
msgid "Pilot Name"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:88
#: allianceauth/srp/templates/srp/data.html:89
msgid "Killboard Link"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:90
#: allianceauth/srp/templates/srp/data.html:91
msgid "Ship Type"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:91
#: allianceauth/srp/templates/srp/data.html:92
msgid "Killboard Loss Amt"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:92
#: allianceauth/srp/templates/srp/data.html:93
msgid "SRP ISK Cost"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:93
#: allianceauth/srp/templates/srp/data.html:94
msgid "Click value to edit Enter to save & next ESC to cancel"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:96
#: allianceauth/srp/templates/srp/data.html:97
msgid "Post Time"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:163
#: allianceauth/srp/templates/srp/data.html:168
msgid "No SRP requests for this fleet."
msgstr ""
@@ -1631,44 +1883,36 @@ msgid "Current"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:40
msgid "Latest Major"
msgid "Latest Stable"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:46
#: allianceauth/templates/allianceauth/admin-status/overview.html:56
#: allianceauth/templates/allianceauth/admin-status/overview.html:66
msgid "Update available"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:50
msgid "Latest Minor"
#: allianceauth/templates/allianceauth/admin-status/overview.html:51
msgid "Latest Pre-Release"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:60
msgid "Latest Patch"
#: allianceauth/templates/allianceauth/admin-status/overview.html:57
msgid "Pre-Release available"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:73
#: allianceauth/templates/allianceauth/admin-status/overview.html:65
msgid "Task Queue"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:90
#: allianceauth/templates/allianceauth/admin-status/overview.html:82
msgid "Error retrieving task queue length"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:92
#: allianceauth/templates/allianceauth/admin-status/overview.html:84
#, python-format
msgid "%(tasks)s task"
msgid_plural "%(tasks)s tasks"
msgstr[0] ""
msgstr[1] ""
#: allianceauth/templates/allianceauth/help.html:4
#: allianceauth/templates/allianceauth/help.html:9
#: allianceauth/templates/allianceauth/side-menu.html:34
msgid "Help"
msgstr ""
#: allianceauth/templates/allianceauth/night-toggle.html:3
msgid "Night"
msgstr ""

View File

@@ -4,17 +4,17 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Joel Falknau <ozirascal@gmail.com>, 2020
# frank1210 <francolopez_16@hotmail.com>, 2020
# Joel Falknau <ozirascal@gmail.com>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-04 23:04+0000\n"
"POT-Creation-Date: 2020-10-11 03:43+0000\n"
"PO-Revision-Date: 2020-02-18 03:14+0000\n"
"Last-Translator: frank1210 <francolopez_16@hotmail.com>, 2020\n"
"Last-Translator: Joel Falknau <ozirascal@gmail.com>, 2020\n"
"Language-Team: Spanish (https://www.transifex.com/alliance-auth/teams/107430/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -27,61 +27,57 @@ msgid "A main character is required to perform that action. Add one below."
msgstr ""
"Un personaje principal es requerido para completar esta accion. Agregue uno"
#: allianceauth/authentication/forms.py:6
#: allianceauth/authentication/forms.py:5
msgid "Email"
msgstr "E-mail"
#: allianceauth/authentication/models.py:76
msgid "State Changed"
msgstr "Estado Cambiado"
#: allianceauth/authentication/models.py:77
#: allianceauth/authentication/models.py:78
#, python-format
msgid "Your user state has been changed to %(state)s"
msgstr "Tu estado de usuario fue cambiado a %(state)s"
msgid "State changed to: %s"
msgstr ""
#: allianceauth/authentication/models.py:79
#, python-format
msgid "Your user's state is now: %(state)s"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:5
#: allianceauth/authentication/templates/authentication/dashboard.html:8
#: allianceauth/templates/allianceauth/side-menu.html:10
#: allianceauth/templates/allianceauth/side-menu.html:11
msgid "Dashboard"
msgstr "Pagina Principal"
#: allianceauth/authentication/templates/authentication/dashboard.html:17
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
msgstr "Personaje Principal"
#: allianceauth/authentication/templates/authentication/dashboard.html:18
#, python-format
msgid ""
"\n"
" Main Character (State: %(state)s)\n"
" "
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:77
#: allianceauth/authentication/templates/authentication/dashboard.html:81
msgid "No main character set."
msgstr "No se ha seleccionado un personaje principal."
#: allianceauth/authentication/templates/authentication/dashboard.html:84
#: allianceauth/authentication/templates/authentication/dashboard.html:88
msgid "Add Character"
msgstr "Agregar Personaje"
#: allianceauth/authentication/templates/authentication/dashboard.html:88
#: allianceauth/authentication/templates/authentication/dashboard.html:92
msgid "Change Main"
msgstr "Cambiar Personaje Principal"
#: allianceauth/authentication/templates/authentication/dashboard.html:97
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:15
msgid "Groups"
msgstr "Grupos"
#: allianceauth/authentication/templates/authentication/dashboard.html:101
msgid "Group Memberships"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:117
#: allianceauth/authentication/templates/authentication/dashboard.html:121
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:41
msgid "Characters"
msgstr "Personajes"
#: allianceauth/authentication/templates/authentication/dashboard.html:125
#: allianceauth/authentication/templates/authentication/dashboard.html:129
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:73
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:22
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:15
@@ -90,13 +86,13 @@ msgstr "Personajes"
msgid "Name"
msgstr "Nombre"
#: allianceauth/authentication/templates/authentication/dashboard.html:126
#: allianceauth/authentication/templates/authentication/dashboard.html:130
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticsview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:46
msgid "Corp"
msgstr "Corporación"
#: allianceauth/authentication/templates/authentication/dashboard.html:127
#: allianceauth/authentication/templates/authentication/dashboard.html:131
#: allianceauth/corputils/templates/corputils/corpstats.html:77
#: allianceauth/hrapplications/templates/hrapplications/view.html:47
msgid "Alliance"
@@ -137,45 +133,52 @@ msgstr "Tu equipo de IT"
msgid "Submit"
msgstr "Enviar"
#: allianceauth/authentication/views.py:39
#: allianceauth/authentication/views.py:74
#, python-format
msgid ""
"Cannot change main character to %(char)s: character owned by a different "
"account."
msgstr ""
#: allianceauth/authentication/views.py:80
#, python-format
msgid "Changed main character to %(char)s"
msgstr "Se ha cambiado tu personaje principal ha %(char)s"
#: allianceauth/authentication/views.py:48
#: allianceauth/authentication/views.py:89
#, python-format
msgid "Added %(name)s to your account."
msgstr "Se ha agregado a %(name)s a tu cuenta"
#: allianceauth/authentication/views.py:50
#: allianceauth/authentication/views.py:91
#, python-format
msgid "Failed to add %(name)s to your account: they already have an account."
msgstr ""
"Se fallo en agregar a %(name)s a tu cuenta: Ya se encuentra registrado en "
"otra cuenta."
#: allianceauth/authentication/views.py:89
#: allianceauth/authentication/views.py:130
msgid "Unable to authenticate as the selected character."
msgstr "Imposible validar con el personaje seleccionado."
#: allianceauth/authentication/views.py:107
#: allianceauth/authentication/views.py:146
msgid "Registration token has expired."
msgstr "El token de registracion expiro."
#: allianceauth/authentication/views.py:159
#: allianceauth/authentication/views.py:201
msgid ""
"Sent confirmation email. Please follow the link to confirm your email "
"address."
msgstr ""
"Confirmacion de mail enviada. Por favor siga el enlace para confirmar "
#: allianceauth/authentication/views.py:164
#: allianceauth/authentication/views.py:206
msgid "Confirmed your email address. Please login to continue."
msgstr ""
"Se ha confirmado su direccion de mail. Por favor igrese su token para "
"continuar."
#: allianceauth/authentication/views.py:169
#: allianceauth/authentication/views.py:211
msgid "Registraion of new accounts it not allowed at this time."
msgstr "Registracion de nuevas cuentas no es permitido por el momento."
@@ -226,8 +229,8 @@ msgstr "Ultima Actualizacion:"
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:28
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:27
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:29
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:37
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:96
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:51
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:110
msgid "Character"
msgstr "Personaje"
@@ -249,6 +252,16 @@ msgstr "Corporacion"
msgid "Killboard"
msgstr "Killboard"
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
msgstr "Personaje Principal"
#: allianceauth/corputils/templates/corputils/corpstats.html:117
#: allianceauth/corputils/templates/corputils/search.html:17
msgid "Main Corporation"
@@ -533,11 +546,22 @@ msgstr "Participacion de flota registrada."
msgid "FAT link has expired."
msgstr "Enlace de participacion expirado."
#: allianceauth/groupmanagement/auth_hooks.py:16
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
msgid "Group Management"
msgstr "Manejo de Grupo"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:5
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:13
msgid "Audit Log"
msgstr "Log de Auditoria"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:18
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:20
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr "Volver"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:25
msgid "Date/Time"
msgstr "Fecha/Hora"
@@ -579,8 +603,8 @@ msgid "Portrait"
msgstr "Retrato"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:30
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:38
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:52
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:111
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:23
msgid "Organization"
msgstr ""
@@ -597,6 +621,12 @@ msgstr "no hay miembros para listar."
msgid "Groups Membership"
msgstr "Membresia de grupos"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:14
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:16
msgid "Groups"
msgstr "Grupos"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:16
msgid "Description"
@@ -607,7 +637,7 @@ msgstr "Descripcion"
#: allianceauth/hrapplications/templates/hrapplications/management.html:85
#: allianceauth/hrapplications/templates/hrapplications/management.html:130
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:27
#: allianceauth/srp/templates/srp/data.html:97
#: allianceauth/srp/templates/srp/data.html:98
msgid "Status"
msgstr "Estado"
@@ -636,7 +666,11 @@ msgstr "Ver Miembros"
msgid "Audit Members"
msgstr "Auditar Miembros"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:64
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:56
msgid "Copy Direct Join Link"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:68
msgid "No groups to list."
msgstr "No hay grupos para listar"
@@ -665,37 +699,37 @@ msgstr "No hay grupos disponibles"
msgid "Groups Management"
msgstr "Manejo de Grupos"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:25
msgid "Join Requests"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:24
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:33
msgid "Leave Requests"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:39
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:98
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:53
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:112
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:20
#: allianceauth/services/modules/openfire/forms.py:6
msgid "Group"
msgstr "Grupo"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:71
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:130
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:85
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:144
msgid "Accept"
msgstr "Aceptar"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:74
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:133
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:88
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:147
#: allianceauth/hrapplications/templates/hrapplications/view.html:85
msgid "Reject"
msgstr "Rechazar"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:83
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
msgid "No group add requests."
msgstr "No hay solicitudes de ingreso."
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:142
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:156
msgid "No group leave requests."
msgstr "No hay solicitudes paradejar el grupo."
@@ -703,11 +737,6 @@ msgstr "No hay solicitudes paradejar el grupo."
msgid "Toggle navigation"
msgstr "Navegacion"
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
#: allianceauth/templates/allianceauth/side-menu.html:23
msgid "Group Management"
msgstr "Manejo de Grupo"
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:21
msgid "Group Requests"
msgstr "Solicitudes de Grupo"
@@ -716,26 +745,26 @@ msgstr "Solicitudes de Grupo"
msgid "Group Membership"
msgstr "Membresia de Grupo"
#: allianceauth/groupmanagement/views.py:164
#: allianceauth/groupmanagement/views.py:162
#, python-format
msgid "Removed user %(user)s from group %(group)s."
msgstr "El usuario %(user)s fue removido del grupo %(group)s"
#: allianceauth/groupmanagement/views.py:166
#: allianceauth/groupmanagement/views.py:164
msgid "User does not exist in that group"
msgstr "El usuario no existe en ese grupos"
#: allianceauth/groupmanagement/views.py:169
#: allianceauth/groupmanagement/views.py:167
msgid "Group does not exist"
msgstr "El grupo no existe"
#: allianceauth/groupmanagement/views.py:196
#: allianceauth/groupmanagement/views.py:194
#, python-format
msgid "Accepted application from %(mainchar)s to %(group)s."
msgstr "Solicitud aceptada de %(mainchar)s a %(group)s"
#: allianceauth/groupmanagement/views.py:203
#: allianceauth/groupmanagement/views.py:236
#: allianceauth/groupmanagement/views.py:201
#: allianceauth/groupmanagement/views.py:234
#, python-format
msgid ""
"An unhandled error occurred while processing the application from "
@@ -744,68 +773,79 @@ msgstr ""
"Ocurrio un error cuando se intento procesar la informacion de %(mainchar)s "
"al grupo %(group)s."
#: allianceauth/groupmanagement/views.py:229
#: allianceauth/groupmanagement/views.py:227
#, python-format
msgid "Rejected application from %(mainchar)s to %(group)s."
msgstr "Se rechazo la solicitud de %(mainchar)s al grupo %(group)s."
#: allianceauth/groupmanagement/views.py:265
#: allianceauth/groupmanagement/views.py:263
#, python-format
msgid "Accepted application from %(mainchar)s to leave %(group)s."
msgstr "Se acepto la solicitud de %(mainchar)s para dejar el grupo %(group)s."
#: allianceauth/groupmanagement/views.py:271
#: allianceauth/groupmanagement/views.py:305
#: allianceauth/groupmanagement/views.py:269
#: allianceauth/groupmanagement/views.py:303
#, python-format
msgid ""
"An unhandled error occured while processing the application from "
"An unhandled error occurred while processing the application from "
"%(mainchar)s to leave %(group)s."
msgstr ""
"Ocurrio un error cuando se intento procesar la informacion de %(mainchar)s "
"para dejar el grupo %(group)s."
#: allianceauth/groupmanagement/views.py:298
#: allianceauth/groupmanagement/views.py:296
#, python-format
msgid "Rejected application from %(mainchar)s to leave %(group)s."
msgstr ""
"Se rechazo la solicitud de %(mainchar)s para dejar el grupo %(group)s."
#: allianceauth/groupmanagement/views.py:345
#: allianceauth/groupmanagement/views.py:342
#: allianceauth/groupmanagement/views.py:354
msgid "You cannot join that group"
msgstr "No puedes unirte a ese grupo"
#: allianceauth/groupmanagement/views.py:369
#: allianceauth/groupmanagement/views.py:407
#: allianceauth/groupmanagement/views.py:348
msgid "You are already a member of that group."
msgstr ""
#: allianceauth/groupmanagement/views.py:363
msgid "You already have a pending application for that group."
msgstr ""
#: allianceauth/groupmanagement/views.py:366
#: allianceauth/groupmanagement/views.py:404
#: allianceauth/hrapplications/templates/hrapplications/management.html:37
#: allianceauth/hrapplications/templates/hrapplications/management.html:72
#: allianceauth/hrapplications/templates/hrapplications/management.html:99
#: allianceauth/hrapplications/templates/hrapplications/management.html:144
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:38
#: allianceauth/hrapplications/templates/hrapplications/view.html:20
#: allianceauth/srp/templates/srp/data.html:125
#: allianceauth/srp/templates/srp/data.html:134
#: allianceauth/srp/templates/srp/management.html:81
msgid "Pending"
msgstr "Pendiente"
#: allianceauth/groupmanagement/views.py:375
#: allianceauth/groupmanagement/views.py:372
#, python-format
msgid "Applied to group %(group)s."
msgstr "Solicitud enviada al grupo %(group)s."
#: allianceauth/groupmanagement/views.py:386
#: allianceauth/groupmanagement/views.py:383
msgid "You cannot leave that group"
msgstr "No puedes dejar el grupos"
#: allianceauth/groupmanagement/views.py:391
#: allianceauth/groupmanagement/views.py:388
msgid "You are not a member of that group"
msgstr "No eres miembro de ese grupo"
#: allianceauth/groupmanagement/views.py:413
#: allianceauth/groupmanagement/views.py:397
msgid "You already have a pending leave request for that group."
msgstr ""
#: allianceauth/groupmanagement/views.py:410
#, python-format
msgid "Applied to leave group %(group)s."
msgstr "Solicitaste dejar el grupo %(group)s."
#: allianceauth/hrapplications/auth_hooks.py:10
#: allianceauth/hrapplications/auth_hooks.py:13
msgid "Applications"
msgstr "Solicitudes"
@@ -862,7 +902,7 @@ msgstr "Usuario"
#: allianceauth/hrapplications/templates/hrapplications/management.html:131
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:28
#: allianceauth/hrapplications/templates/hrapplications/view.html:75
#: allianceauth/srp/templates/srp/data.html:99
#: allianceauth/srp/templates/srp/data.html:100
#: allianceauth/srp/templates/srp/management.html:46
msgid "Actions"
msgstr "Acciones"
@@ -872,7 +912,7 @@ msgstr "Acciones"
#: allianceauth/hrapplications/templates/hrapplications/management.html:147
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:40
#: allianceauth/hrapplications/templates/hrapplications/view.html:16
#: allianceauth/srp/templates/srp/data.html:117
#: allianceauth/srp/templates/srp/data.html:126
msgid "Approved"
msgstr "Aprovado"
@@ -880,7 +920,7 @@ msgstr "Aprovado"
#: allianceauth/hrapplications/templates/hrapplications/management.html:104
#: allianceauth/hrapplications/templates/hrapplications/management.html:149
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:42
#: allianceauth/srp/templates/srp/data.html:121
#: allianceauth/srp/templates/srp/data.html:130
msgid "Rejected"
msgstr "Rechazado"
@@ -1146,10 +1186,6 @@ msgstr "Se guardaron los cambios para la operacion %(opname)s"
msgid "Permissions Audit"
msgstr "Auditar Permisos"
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr "Volver"
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:22
msgid "User / Character"
msgstr ""
@@ -1195,6 +1231,18 @@ msgstr "Usuarios"
msgid "States"
msgstr "Estados"
#: allianceauth/services/abstract.py:72
msgid "That service account already exists"
msgstr ""
#: allianceauth/services/abstract.py:104
msgid "Successfully set your {} password"
msgstr ""
#: allianceauth/services/auth_hooks.py:11
msgid "Services"
msgstr ""
#: allianceauth/services/forms.py:6
msgid "Name of Fleet:"
msgstr "Nombre de la flota:"
@@ -1255,19 +1303,111 @@ msgstr "Contraseña"
msgid "Password must be at least 8 characters long."
msgstr "La contraseña tiene que tener 8 caracteres de largo minimo"
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:23
#: allianceauth/services/modules/discord/models.py:225
msgid "Discord Account Disabled"
msgstr ""
#: allianceauth/services/modules/discord/models.py:227
msgid ""
"Your Discord account was disabeled automatically by Auth. If you think this "
"was a mistake, please contact an admin."
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:18
msgid "Join the Discord server"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:22
msgid "Leave- and rejoin the Discord Server (Reset)"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:25
msgid "Leave the Discord server"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:32
msgid "Link Discord Server"
msgstr "Enlace a servidor de Discord"
#: allianceauth/services/modules/openfire/forms.py:7
msgid "Message"
msgstr "Mensaje"
#: allianceauth/services/modules/discord/views.py:30
msgid "Deactivated Discord account."
msgstr ""
#: allianceauth/services/modules/discord/views.py:36
#: allianceauth/services/modules/discord/views.py:59
msgid "An error occurred while processing your Discord account."
msgstr ""
#: allianceauth/services/modules/discord/views.py:102
msgid "Your Discord account has been successfully activated."
msgstr ""
#: allianceauth/services/modules/discord/views.py:108
msgid ""
"An error occurred while trying to activate your Discord account. Please try "
"again."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:37
msgid "You are not authorized to access Discourse."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:42
msgid "You must have a main character set to access Discourse."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:52
msgid ""
"No SSO payload or signature. Please contact support if this problem "
"persists."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:62
#: allianceauth/services/modules/discourse/views.py:70
msgid "Invalid payload. Please contact support if this problem persists."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:31
msgid "Activated IPSuite4 account."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:40
#: allianceauth/services/modules/ips4/views.py:62
#: allianceauth/services/modules/ips4/views.py:83
#: allianceauth/services/modules/ips4/views.py:103
msgid "An error occurred while processing your IPSuite4 account."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:53
msgid "Reset IPSuite4 password."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:80
msgid "Set IPSuite4 password."
msgstr ""
#: allianceauth/services/modules/ips4/views.py:100
msgid "Deactivated IPSuite4 account."
msgstr ""
#: allianceauth/services/modules/openfire/auth_hooks.py:26
msgid "Jabber"
msgstr ""
#: allianceauth/services/modules/openfire/auth_hooks.py:78
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:6
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:11
msgid "Jabber Broadcast"
msgstr "Anuncio por Jabber"
#: allianceauth/services/modules/openfire/auth_hooks.py:91
msgid "Fleet Broadcast Formatter"
msgstr ""
#: allianceauth/services/modules/openfire/forms.py:7
msgid "Message"
msgstr "Mensaje"
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:17
msgid "Broadcast Sent!!"
msgstr "Ping Enviado"
@@ -1276,6 +1416,76 @@ msgstr "Ping Enviado"
msgid "Broadcast"
msgstr "Anuncio"
#: allianceauth/services/modules/openfire/views.py:35
msgid "Activated jabber account."
msgstr ""
#: allianceauth/services/modules/openfire/views.py:44
#: allianceauth/services/modules/openfire/views.py:57
#: allianceauth/services/modules/openfire/views.py:78
#: allianceauth/services/modules/openfire/views.py:151
msgid "An error occurred while processing your jabber account."
msgstr ""
#: allianceauth/services/modules/openfire/views.py:70
msgid "Reset jabber password."
msgstr ""
#: allianceauth/services/modules/openfire/views.py:119
#, python-format
msgid "Sent jabber broadcast to %s"
msgstr ""
#: allianceauth/services/modules/openfire/views.py:148
msgid "Set jabber password."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:34
msgid "Activated forum account."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:43
#: allianceauth/services/modules/phpbb3/views.py:57
#: allianceauth/services/modules/phpbb3/views.py:80
#: allianceauth/services/modules/phpbb3/views.py:103
msgid "An error occurred while processing your forum account."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:54
msgid "Deactivated forum account."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:71
msgid "Reset forum password."
msgstr ""
#: allianceauth/services/modules/phpbb3/views.py:100
msgid "Set forum password."
msgstr ""
#: allianceauth/services/modules/smf/views.py:34
msgid "Activated SMF account."
msgstr ""
#: allianceauth/services/modules/smf/views.py:43
#: allianceauth/services/modules/smf/views.py:58
#: allianceauth/services/modules/smf/views.py:80
#: allianceauth/services/modules/smf/views.py:103
msgid "An error occurred while processing your SMF account."
msgstr ""
#: allianceauth/services/modules/smf/views.py:55
msgid "Deactivated SMF account."
msgstr ""
#: allianceauth/services/modules/smf/views.py:72
msgid "Reset SMF password."
msgstr ""
#: allianceauth/services/modules/smf/views.py:100
msgid "Set SMF password."
msgstr ""
#: allianceauth/services/modules/teamspeak3/forms.py:14
#, python-format
msgid "Unable to locate user %s on server"
@@ -1299,6 +1509,47 @@ msgstr "Unirse al Servidor"
msgid "Continue"
msgstr "Continuar"
#: allianceauth/services/modules/teamspeak3/views.py:34
msgid "Activated TeamSpeak3 account."
msgstr ""
#: allianceauth/services/modules/teamspeak3/views.py:37
#: allianceauth/services/modules/teamspeak3/views.py:74
#: allianceauth/services/modules/teamspeak3/views.py:100
msgid "An error occurred while processing your TeamSpeak3 account."
msgstr ""
#: allianceauth/services/modules/teamspeak3/views.py:71
msgid "Deactivated TeamSpeak3 account."
msgstr ""
#: allianceauth/services/modules/teamspeak3/views.py:97
msgid "Reset TeamSpeak3 permission key."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:30
msgid "Activated XenForo account."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:40
#: allianceauth/services/modules/xenforo/views.py:52
#: allianceauth/services/modules/xenforo/views.py:73
#: allianceauth/services/modules/xenforo/views.py:94
msgid "An error occurred while processing your XenForo account."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:50
msgid "Deactivated XenForo account."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:65
msgid "Reset XenForo account password."
msgstr ""
#: allianceauth/services/modules/xenforo/views.py:91
msgid "Changed XenForo password."
msgstr ""
#: allianceauth/services/templates/services/fleetformattertool.html:6
msgid "Fleet Formatter Tool"
msgstr "Formato de Ping"
@@ -1359,7 +1610,7 @@ msgstr "Servicio"
msgid "Domain"
msgstr "Dominio"
#: allianceauth/srp/auth_hooks.py:9
#: allianceauth/srp/auth_hooks.py:12
msgid "Ship Replacement"
msgstr "Reemplazo de Nave"
@@ -1373,7 +1624,7 @@ msgstr "Hora de flota"
msgid "Fleet Doctrine"
msgstr "Doctrina"
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:89
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:90
msgid "Additional Info"
msgstr "Informacion Adicional"
@@ -1402,63 +1653,63 @@ msgstr "Crear SRP"
msgid "Give this link to the line members"
msgstr "Entregar este enlace a los miembros"
#: allianceauth/srp/templates/srp/data.html:48
#: allianceauth/srp/templates/srp/data.html:49
msgid "SRP Fleet Data"
msgstr "Informacion de SRP de la flota"
#: allianceauth/srp/templates/srp/data.html:53
#: allianceauth/srp/templates/srp/data.html:54
msgid "Mark Incomplete"
msgstr "Marcar como Incompleto"
#: allianceauth/srp/templates/srp/data.html:57
#: allianceauth/srp/templates/srp/data.html:58
msgid "Mark Completed"
msgstr "Marcar como Completo"
#: allianceauth/srp/templates/srp/data.html:69
#: allianceauth/srp/templates/srp/data.html:145
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:156
msgid "Total Losses:"
msgstr "Perdidas Totales:"
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:146
#: allianceauth/srp/templates/srp/data.html:71
#: allianceauth/srp/templates/srp/data.html:157
#: allianceauth/srp/templates/srp/management.html:30
msgid "Total ISK Cost:"
msgstr "Costo Total:"
#: allianceauth/srp/templates/srp/data.html:78
#: allianceauth/srp/templates/srp/data.html:154
#: allianceauth/srp/templates/srp/data.html:79
#: allianceauth/srp/templates/srp/data.html:165
msgid "Are you sure you want to delete SRP requests?"
msgstr "Estas seguro que quiere borrar las solicitudes de SRP"
#: allianceauth/srp/templates/srp/data.html:87
#: allianceauth/srp/templates/srp/data.html:88
msgid "Pilot Name"
msgstr "Nombre del Piloto"
#: allianceauth/srp/templates/srp/data.html:88
#: allianceauth/srp/templates/srp/data.html:89
msgid "Killboard Link"
msgstr "Enlace de la Muerte"
#: allianceauth/srp/templates/srp/data.html:90
#: allianceauth/srp/templates/srp/data.html:91
msgid "Ship Type"
msgstr "Tipo"
#: allianceauth/srp/templates/srp/data.html:91
#: allianceauth/srp/templates/srp/data.html:92
msgid "Killboard Loss Amt"
msgstr "Monto de la perdida en ZKB"
#: allianceauth/srp/templates/srp/data.html:92
#: allianceauth/srp/templates/srp/data.html:93
msgid "SRP ISK Cost"
msgstr "Costo del SRP"
#: allianceauth/srp/templates/srp/data.html:93
#: allianceauth/srp/templates/srp/data.html:94
msgid "Click value to edit Enter to save & next ESC to cancel"
msgstr ""
#: allianceauth/srp/templates/srp/data.html:96
#: allianceauth/srp/templates/srp/data.html:97
msgid "Post Time"
msgstr "Tiempo"
#: allianceauth/srp/templates/srp/data.html:163
#: allianceauth/srp/templates/srp/data.html:174
msgid "No SRP requests for this fleet."
msgstr "No hay solicitudes de SRP para esta flota."
@@ -1650,44 +1901,36 @@ msgid "Current"
msgstr "Actual"
#: allianceauth/templates/allianceauth/admin-status/overview.html:40
msgid "Latest Major"
msgstr "Ultimo Importante"
msgid "Latest Stable"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:46
#: allianceauth/templates/allianceauth/admin-status/overview.html:56
#: allianceauth/templates/allianceauth/admin-status/overview.html:66
msgid "Update available"
msgstr "Actualizacion Disponible"
#: allianceauth/templates/allianceauth/admin-status/overview.html:50
msgid "Latest Minor"
msgstr "Ultimo no importante"
#: allianceauth/templates/allianceauth/admin-status/overview.html:51
msgid "Latest Pre-Release"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:60
msgid "Latest Patch"
msgstr "Ultimo Parche"
#: allianceauth/templates/allianceauth/admin-status/overview.html:57
msgid "Pre-Release available"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:73
#: allianceauth/templates/allianceauth/admin-status/overview.html:65
msgid "Task Queue"
msgstr "Cola de Tareas"
#: allianceauth/templates/allianceauth/admin-status/overview.html:90
#: allianceauth/templates/allianceauth/admin-status/overview.html:82
msgid "Error retrieving task queue length"
msgstr "Error al conseguir la cola de tareas"
#: allianceauth/templates/allianceauth/admin-status/overview.html:92
#: allianceauth/templates/allianceauth/admin-status/overview.html:84
#, python-format
msgid "%(tasks)s task"
msgid_plural "%(tasks)s tasks"
msgstr[0] ""
msgstr[1] ""
#: allianceauth/templates/allianceauth/help.html:4
#: allianceauth/templates/allianceauth/help.html:9
#: allianceauth/templates/allianceauth/side-menu.html:34
msgid "Help"
msgstr "Ayuda"
#: allianceauth/templates/allianceauth/night-toggle.html:3
msgid "Night"
msgstr "Noche"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,8 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Jesse . <sgeine@hotmail.com>, 2020
# Aaron BuBu <351793078@qq.com>, 2020
# Joel Falknau <ozirascal@gmail.com>, 2020
#
#, fuzzy
@@ -11,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-04 23:04+0000\n"
"POT-Creation-Date: 2020-10-11 03:43+0000\n"
"PO-Revision-Date: 2020-02-18 03:14+0000\n"
"Last-Translator: Joel Falknau <ozirascal@gmail.com>, 2020\n"
"Language-Team: Chinese Simplified (https://www.transifex.com/alliance-auth/teams/107430/zh-Hans/)\n"
@@ -25,61 +27,57 @@ msgstr ""
msgid "A main character is required to perform that action. Add one below."
msgstr "只有主要角色才能执行这个操作。在下面添加一个"
#: allianceauth/authentication/forms.py:6
#: allianceauth/authentication/forms.py:5
msgid "Email"
msgstr "电子邮箱"
#: allianceauth/authentication/models.py:76
msgid "State Changed"
msgstr "状态已经更改"
#: allianceauth/authentication/models.py:77
#: allianceauth/authentication/models.py:78
#, python-format
msgid "Your user state has been changed to %(state)s"
msgstr "您的用户状态已经更改为%(state)s"
msgid "State changed to: %s"
msgstr ""
#: allianceauth/authentication/models.py:79
#, python-format
msgid "Your user's state is now: %(state)s"
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:5
#: allianceauth/authentication/templates/authentication/dashboard.html:8
#: allianceauth/templates/allianceauth/side-menu.html:10
#: allianceauth/templates/allianceauth/side-menu.html:11
msgid "Dashboard"
msgstr "账户总览"
#: allianceauth/authentication/templates/authentication/dashboard.html:17
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
msgstr "主要角色"
#: allianceauth/authentication/templates/authentication/dashboard.html:18
#, python-format
msgid ""
"\n"
" Main Character (State: %(state)s)\n"
" "
msgstr ""
#: allianceauth/authentication/templates/authentication/dashboard.html:77
#: allianceauth/authentication/templates/authentication/dashboard.html:81
msgid "No main character set."
msgstr "没有主要角色组"
#: allianceauth/authentication/templates/authentication/dashboard.html:84
#: allianceauth/authentication/templates/authentication/dashboard.html:88
msgid "Add Character"
msgstr "添加角色"
#: allianceauth/authentication/templates/authentication/dashboard.html:88
#: allianceauth/authentication/templates/authentication/dashboard.html:92
msgid "Change Main"
msgstr "修改主要角色"
#: allianceauth/authentication/templates/authentication/dashboard.html:97
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:15
msgid "Groups"
msgstr "群组"
#: allianceauth/authentication/templates/authentication/dashboard.html:101
msgid "Group Memberships"
msgstr "用户组成员"
#: allianceauth/authentication/templates/authentication/dashboard.html:117
#: allianceauth/authentication/templates/authentication/dashboard.html:121
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:41
msgid "Characters"
msgstr "角色"
#: allianceauth/authentication/templates/authentication/dashboard.html:125
#: allianceauth/authentication/templates/authentication/dashboard.html:129
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:73
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:22
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:15
@@ -88,13 +86,13 @@ msgstr "角色"
msgid "Name"
msgstr "角色名"
#: allianceauth/authentication/templates/authentication/dashboard.html:126
#: allianceauth/authentication/templates/authentication/dashboard.html:130
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticsview.html:23
#: allianceauth/hrapplications/templates/hrapplications/view.html:46
msgid "Corp"
msgstr "所在公司"
#: allianceauth/authentication/templates/authentication/dashboard.html:127
#: allianceauth/authentication/templates/authentication/dashboard.html:131
#: allianceauth/corputils/templates/corputils/corpstats.html:77
#: allianceauth/hrapplications/templates/hrapplications/view.html:47
msgid "Alliance"
@@ -135,40 +133,47 @@ msgstr "您的IT团队"
msgid "Submit"
msgstr "提交"
#: allianceauth/authentication/views.py:39
#: allianceauth/authentication/views.py:74
#, python-format
msgid ""
"Cannot change main character to %(char)s: character owned by a different "
"account."
msgstr "不能修改主角色为%(char)s这个角色被另一个账户所拥有"
#: allianceauth/authentication/views.py:80
#, python-format
msgid "Changed main character to %(char)s"
msgstr "修改主要角色为%(char)s"
#: allianceauth/authentication/views.py:48
#: allianceauth/authentication/views.py:89
#, python-format
msgid "Added %(name)s to your account."
msgstr "添加%(name)s到您的账户"
#: allianceauth/authentication/views.py:50
#: allianceauth/authentication/views.py:91
#, python-format
msgid "Failed to add %(name)s to your account: they already have an account."
msgstr "添加%(name)s到您的账户失败他们已经在一个账户中了"
#: allianceauth/authentication/views.py:89
#: allianceauth/authentication/views.py:130
msgid "Unable to authenticate as the selected character."
msgstr "无法作为选定的角色进行身份验证"
#: allianceauth/authentication/views.py:107
#: allianceauth/authentication/views.py:146
msgid "Registration token has expired."
msgstr "注册令牌过期。"
#: allianceauth/authentication/views.py:159
#: allianceauth/authentication/views.py:201
msgid ""
"Sent confirmation email. Please follow the link to confirm your email "
"address."
msgstr "已经发送了确认邮件。请按照链接确定您的电邮地址"
#: allianceauth/authentication/views.py:164
#: allianceauth/authentication/views.py:206
msgid "Confirmed your email address. Please login to continue."
msgstr "已确认您的电邮地址。请登录以继续"
#: allianceauth/authentication/views.py:169
#: allianceauth/authentication/views.py:211
msgid "Registraion of new accounts it not allowed at this time."
msgstr "现在不允许注册新账户。"
@@ -219,8 +224,8 @@ msgstr "最后一次更新"
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:28
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:27
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:29
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:37
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:96
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:51
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:110
msgid "Character"
msgstr "角色"
@@ -242,6 +247,16 @@ msgstr "公司"
msgid "Killboard"
msgstr "KB板"
#: allianceauth/corputils/templates/corputils/corpstats.html:116
#: allianceauth/corputils/templates/corputils/search.html:16
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkstatisticscorpview.html:22
#: allianceauth/hrapplications/templates/hrapplications/management.html:83
#: allianceauth/hrapplications/templates/hrapplications/management.html:128
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:25
#: allianceauth/hrapplications/templates/hrapplications/view.html:32
msgid "Main Character"
msgstr "主要角色"
#: allianceauth/corputils/templates/corputils/corpstats.html:117
#: allianceauth/corputils/templates/corputils/search.html:17
msgid "Main Corporation"
@@ -523,11 +538,22 @@ msgstr "成功注册舰队PAP"
msgid "FAT link has expired."
msgstr "PAP链接已过期"
#: allianceauth/groupmanagement/auth_hooks.py:16
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
msgid "Group Management"
msgstr "用户组管理"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:5
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:13
msgid "Audit Log"
msgstr "审计日志"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:18
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:20
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr "返回"
#: allianceauth/groupmanagement/templates/groupmanagement/audit.html:25
msgid "Date/Time"
msgstr "日期/时间"
@@ -569,8 +595,8 @@ msgid "Portrait"
msgstr "人物头像"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembers.html:30
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:38
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:52
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:111
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:23
msgid "Organization"
msgstr "组织"
@@ -587,6 +613,12 @@ msgstr "用户组里没人呀,你叫我怎么列"
msgid "Groups Membership"
msgstr "用户组成员"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:14
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:40
#: allianceauth/templates/allianceauth/side-menu.html:16
msgid "Groups"
msgstr "群组"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:16
msgid "Description"
@@ -597,7 +629,7 @@ msgstr "描述"
#: allianceauth/hrapplications/templates/hrapplications/management.html:85
#: allianceauth/hrapplications/templates/hrapplications/management.html:130
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:27
#: allianceauth/srp/templates/srp/data.html:97
#: allianceauth/srp/templates/srp/data.html:98
msgid "Status"
msgstr "状态"
@@ -626,7 +658,11 @@ msgstr "查看成员"
msgid "Audit Members"
msgstr "编辑成员"
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:64
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:56
msgid "Copy Direct Join Link"
msgstr ""
#: allianceauth/groupmanagement/templates/groupmanagement/groupmembership.html:68
msgid "No groups to list."
msgstr "无可用组"
@@ -655,37 +691,37 @@ msgstr "没有可用用户组"
msgid "Groups Management"
msgstr "用户组管理"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:23
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:25
msgid "Join Requests"
msgstr "入组的请求"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:24
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:33
msgid "Leave Requests"
msgstr "离组的请求"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:39
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:98
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:53
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:112
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:20
#: allianceauth/services/modules/openfire/forms.py:6
msgid "Group"
msgstr "用户组"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:71
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:130
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:85
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:144
msgid "Accept"
msgstr "接受"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:74
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:133
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:88
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:147
#: allianceauth/hrapplications/templates/hrapplications/view.html:85
msgid "Reject"
msgstr "拒绝"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:83
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:97
msgid "No group add requests."
msgstr "没有加入用户组的请求,小老弟你是不是摇不到人"
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:142
#: allianceauth/groupmanagement/templates/groupmanagement/index.html:156
msgid "No group leave requests."
msgstr "没有离开用户组的请求,小老弟你人缘可以啊?"
@@ -693,11 +729,6 @@ msgstr "没有离开用户组的请求,小老弟你人缘可以啊?"
msgid "Toggle navigation"
msgstr "打开导航栏"
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:15
#: allianceauth/templates/allianceauth/side-menu.html:23
msgid "Group Management"
msgstr "用户组管理"
#: allianceauth/groupmanagement/templates/groupmanagement/menu.html:21
msgid "Group Requests"
msgstr "用户组请求"
@@ -706,91 +737,104 @@ msgstr "用户组请求"
msgid "Group Membership"
msgstr "用户组成员"
#: allianceauth/groupmanagement/views.py:164
#: allianceauth/groupmanagement/views.py:162
#, python-format
msgid "Removed user %(user)s from group %(group)s."
msgstr "已将用户%(user)s从用户组%(group)s中移除"
#: allianceauth/groupmanagement/views.py:166
#: allianceauth/groupmanagement/views.py:164
msgid "User does not exist in that group"
msgstr "那个用户组中不存在这个用户"
#: allianceauth/groupmanagement/views.py:169
#: allianceauth/groupmanagement/views.py:167
msgid "Group does not exist"
msgstr "用户组不存在"
#: allianceauth/groupmanagement/views.py:196
#: allianceauth/groupmanagement/views.py:194
#, python-format
msgid "Accepted application from %(mainchar)s to %(group)s."
msgstr "已接受用户%(mainchar)s加入%(group)s的申请"
#: allianceauth/groupmanagement/views.py:203
#: allianceauth/groupmanagement/views.py:236
#: allianceauth/groupmanagement/views.py:201
#: allianceauth/groupmanagement/views.py:234
#, python-format
msgid ""
"An unhandled error occurred while processing the application from "
"%(mainchar)s to %(group)s."
msgstr "在处理用户%(mainchar)s加入%(group)s的申请的过程中出现了一个搞不定的错误"
#: allianceauth/groupmanagement/views.py:229
#: allianceauth/groupmanagement/views.py:227
#, python-format
msgid "Rejected application from %(mainchar)s to %(group)s."
msgstr "%(mainchar)s加入%(group)s的申请已拒绝"
#: allianceauth/groupmanagement/views.py:265
#: allianceauth/groupmanagement/views.py:263
#, python-format
msgid "Accepted application from %(mainchar)s to leave %(group)s."
msgstr "%(mainchar)s加入%(group)s的申请已通过"
#: allianceauth/groupmanagement/views.py:271
#: allianceauth/groupmanagement/views.py:305
#: allianceauth/groupmanagement/views.py:269
#: allianceauth/groupmanagement/views.py:303
#, python-format
msgid ""
"An unhandled error occured while processing the application from "
"An unhandled error occurred while processing the application from "
"%(mainchar)s to leave %(group)s."
msgstr "在处理%(mainchar)s离开%(group)s的请求时发生了搞不定的错误"
msgstr "在处理%(mainchar)s离开%(group)s的程序时发生了未知的错误"
#: allianceauth/groupmanagement/views.py:298
#: allianceauth/groupmanagement/views.py:296
#, python-format
msgid "Rejected application from %(mainchar)s to leave %(group)s."
msgstr "%(mainchar)s离开%(group)s的请求已被拒绝"
#: allianceauth/groupmanagement/views.py:345
#: allianceauth/groupmanagement/views.py:342
#: allianceauth/groupmanagement/views.py:354
msgid "You cannot join that group"
msgstr "你无法加入那个用户组"
#: allianceauth/groupmanagement/views.py:369
#: allianceauth/groupmanagement/views.py:407
#: allianceauth/groupmanagement/views.py:348
msgid "You are already a member of that group."
msgstr "你已经是那个群组的一员了。"
#: allianceauth/groupmanagement/views.py:363
msgid "You already have a pending application for that group."
msgstr "你已经有了该组的未决申请"
#: allianceauth/groupmanagement/views.py:366
#: allianceauth/groupmanagement/views.py:404
#: allianceauth/hrapplications/templates/hrapplications/management.html:37
#: allianceauth/hrapplications/templates/hrapplications/management.html:72
#: allianceauth/hrapplications/templates/hrapplications/management.html:99
#: allianceauth/hrapplications/templates/hrapplications/management.html:144
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:38
#: allianceauth/hrapplications/templates/hrapplications/view.html:20
#: allianceauth/srp/templates/srp/data.html:125
#: allianceauth/srp/templates/srp/data.html:134
#: allianceauth/srp/templates/srp/management.html:81
msgid "Pending"
msgstr "待定"
#: allianceauth/groupmanagement/views.py:375
#: allianceauth/groupmanagement/views.py:372
#, python-format
msgid "Applied to group %(group)s."
msgstr "修改已经应用到%(group)s啦"
#: allianceauth/groupmanagement/views.py:386
#: allianceauth/groupmanagement/views.py:383
msgid "You cannot leave that group"
msgstr "你无法离开那个用户组"
#: allianceauth/groupmanagement/views.py:391
#: allianceauth/groupmanagement/views.py:388
msgid "You are not a member of that group"
msgstr "你不是那个用户组的成员"
#: allianceauth/groupmanagement/views.py:413
#: allianceauth/groupmanagement/views.py:397
msgid "You already have a pending leave request for that group."
msgstr "你已经有了该组的未决离开请求"
#: allianceauth/groupmanagement/views.py:410
#, python-format
msgid "Applied to leave group %(group)s."
msgstr "已经离开群组%(group)s"
#: allianceauth/hrapplications/auth_hooks.py:10
#: allianceauth/hrapplications/auth_hooks.py:13
msgid "Applications"
msgstr "申请"
@@ -847,7 +891,7 @@ msgstr "用户名"
#: allianceauth/hrapplications/templates/hrapplications/management.html:131
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:28
#: allianceauth/hrapplications/templates/hrapplications/view.html:75
#: allianceauth/srp/templates/srp/data.html:99
#: allianceauth/srp/templates/srp/data.html:100
#: allianceauth/srp/templates/srp/management.html:46
msgid "Actions"
msgstr "操作"
@@ -857,7 +901,7 @@ msgstr "操作"
#: allianceauth/hrapplications/templates/hrapplications/management.html:147
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:40
#: allianceauth/hrapplications/templates/hrapplications/view.html:16
#: allianceauth/srp/templates/srp/data.html:117
#: allianceauth/srp/templates/srp/data.html:126
msgid "Approved"
msgstr "通过"
@@ -865,7 +909,7 @@ msgstr "通过"
#: allianceauth/hrapplications/templates/hrapplications/management.html:104
#: allianceauth/hrapplications/templates/hrapplications/management.html:149
#: allianceauth/hrapplications/templates/hrapplications/searchview.html:42
#: allianceauth/srp/templates/srp/data.html:121
#: allianceauth/srp/templates/srp/data.html:130
msgid "Rejected"
msgstr "拒绝"
@@ -1131,10 +1175,6 @@ msgstr "对搞事时间节点%(opname)s的修改保存了朝令夕改你是
msgid "Permissions Audit"
msgstr "放行记录审计"
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:13
msgid "Back"
msgstr "返回"
#: allianceauth/permissions_tool/templates/permissions_tool/audit.html:22
msgid "User / Character"
msgstr "用户/角色"
@@ -1180,6 +1220,18 @@ msgstr "用户"
msgid "States"
msgstr "声望"
#: allianceauth/services/abstract.py:72
msgid "That service account already exists"
msgstr "该服务账户仍然存在"
#: allianceauth/services/abstract.py:104
msgid "Successfully set your {} password"
msgstr "成功修改了你的[]密码"
#: allianceauth/services/auth_hooks.py:11
msgid "Services"
msgstr "服务"
#: allianceauth/services/forms.py:6
msgid "Name of Fleet:"
msgstr "舰队名称"
@@ -1240,19 +1292,111 @@ msgstr "密码"
msgid "Password must be at least 8 characters long."
msgstr "密码至少要有8个字符啊你也太不注重安全啦"
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:23
#: allianceauth/services/modules/discord/models.py:225
msgid "Discord Account Disabled"
msgstr ""
#: allianceauth/services/modules/discord/models.py:227
msgid ""
"Your Discord account was disabeled automatically by Auth. If you think this "
"was a mistake, please contact an admin."
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:18
msgid "Join the Discord server"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:22
msgid "Leave- and rejoin the Discord Server (Reset)"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:25
msgid "Leave the Discord server"
msgstr ""
#: allianceauth/services/modules/discord/templates/services/discord/discord_service_ctrl.html:32
msgid "Link Discord Server"
msgstr "链接到Discord服务器"
#: allianceauth/services/modules/openfire/forms.py:7
msgid "Message"
msgstr "消息"
#: allianceauth/services/modules/discord/views.py:30
msgid "Deactivated Discord account."
msgstr "停用Discord账户"
#: allianceauth/services/modules/discord/views.py:36
#: allianceauth/services/modules/discord/views.py:59
msgid "An error occurred while processing your Discord account."
msgstr "在处理你的Discord账户时出错。"
#: allianceauth/services/modules/discord/views.py:102
msgid "Your Discord account has been successfully activated."
msgstr ""
#: allianceauth/services/modules/discord/views.py:108
msgid ""
"An error occurred while trying to activate your Discord account. Please try "
"again."
msgstr ""
#: allianceauth/services/modules/discourse/views.py:37
msgid "You are not authorized to access Discourse."
msgstr "你无权访问Discourse"
#: allianceauth/services/modules/discourse/views.py:42
msgid "You must have a main character set to access Discourse."
msgstr "你必须得有一个主要角色来访问Discourse"
#: allianceauth/services/modules/discourse/views.py:52
msgid ""
"No SSO payload or signature. Please contact support if this problem "
"persists."
msgstr "没有在Seat上检测到SSO。如果该问题依然存在请联系技术支持"
#: allianceauth/services/modules/discourse/views.py:62
#: allianceauth/services/modules/discourse/views.py:70
msgid "Invalid payload. Please contact support if this problem persists."
msgstr "无效的SSO验证。如果该问题依然存在请联系技术支持。"
#: allianceauth/services/modules/ips4/views.py:31
msgid "Activated IPSuite4 account."
msgstr "完成激活IPSuite4账户"
#: allianceauth/services/modules/ips4/views.py:40
#: allianceauth/services/modules/ips4/views.py:62
#: allianceauth/services/modules/ips4/views.py:83
#: allianceauth/services/modules/ips4/views.py:103
msgid "An error occurred while processing your IPSuite4 account."
msgstr "在处理你的IPSuite4账户时出错"
#: allianceauth/services/modules/ips4/views.py:53
msgid "Reset IPSuite4 password."
msgstr "重置IPSuite4密码"
#: allianceauth/services/modules/ips4/views.py:80
msgid "Set IPSuite4 password."
msgstr "修改IPSuite4密码"
#: allianceauth/services/modules/ips4/views.py:100
msgid "Deactivated IPSuite4 account."
msgstr "停用IPSuite4账户"
#: allianceauth/services/modules/openfire/auth_hooks.py:26
msgid "Jabber"
msgstr "Jabber"
#: allianceauth/services/modules/openfire/auth_hooks.py:78
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:6
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:11
msgid "Jabber Broadcast"
msgstr "Jabber广播"
#: allianceauth/services/modules/openfire/auth_hooks.py:91
msgid "Fleet Broadcast Formatter"
msgstr "舰队广播设置"
#: allianceauth/services/modules/openfire/forms.py:7
msgid "Message"
msgstr "消息"
#: allianceauth/services/modules/openfire/templates/services/openfire/broadcast.html:17
msgid "Broadcast Sent!!"
msgstr "广播出去了!"
@@ -1261,6 +1405,76 @@ msgstr "广播出去了!"
msgid "Broadcast"
msgstr "广播"
#: allianceauth/services/modules/openfire/views.py:35
msgid "Activated jabber account."
msgstr "成功激活jabber账户"
#: allianceauth/services/modules/openfire/views.py:44
#: allianceauth/services/modules/openfire/views.py:57
#: allianceauth/services/modules/openfire/views.py:78
#: allianceauth/services/modules/openfire/views.py:151
msgid "An error occurred while processing your jabber account."
msgstr "在处理你的jabber账户时出错"
#: allianceauth/services/modules/openfire/views.py:70
msgid "Reset jabber password."
msgstr "重置jabber密码"
#: allianceauth/services/modules/openfire/views.py:119
#, python-format
msgid "Sent jabber broadcast to %s"
msgstr "已经将jabber广播送到了%s"
#: allianceauth/services/modules/openfire/views.py:148
msgid "Set jabber password."
msgstr "修改jabber密码"
#: allianceauth/services/modules/phpbb3/views.py:34
msgid "Activated forum account."
msgstr "成功激活论坛账户"
#: allianceauth/services/modules/phpbb3/views.py:43
#: allianceauth/services/modules/phpbb3/views.py:57
#: allianceauth/services/modules/phpbb3/views.py:80
#: allianceauth/services/modules/phpbb3/views.py:103
msgid "An error occurred while processing your forum account."
msgstr "在处理你的论坛账户时发生了一个错误"
#: allianceauth/services/modules/phpbb3/views.py:54
msgid "Deactivated forum account."
msgstr "停用论坛账户"
#: allianceauth/services/modules/phpbb3/views.py:71
msgid "Reset forum password."
msgstr "重置论坛密码"
#: allianceauth/services/modules/phpbb3/views.py:100
msgid "Set forum password."
msgstr "修改论坛密码"
#: allianceauth/services/modules/smf/views.py:34
msgid "Activated SMF account."
msgstr "成功激活SMF论坛账户"
#: allianceauth/services/modules/smf/views.py:43
#: allianceauth/services/modules/smf/views.py:58
#: allianceauth/services/modules/smf/views.py:80
#: allianceauth/services/modules/smf/views.py:103
msgid "An error occurred while processing your SMF account."
msgstr "在处理你的SMF论坛账户时发生了一个错误"
#: allianceauth/services/modules/smf/views.py:55
msgid "Deactivated SMF account."
msgstr "停用SMF论坛账户"
#: allianceauth/services/modules/smf/views.py:72
msgid "Reset SMF password."
msgstr "重置SMF密码"
#: allianceauth/services/modules/smf/views.py:100
msgid "Set SMF password."
msgstr "修改SMF论坛密码"
#: allianceauth/services/modules/teamspeak3/forms.py:14
#, python-format
msgid "Unable to locate user %s on server"
@@ -1284,6 +1498,47 @@ msgstr "加入服务器"
msgid "Continue"
msgstr "下一个"
#: allianceauth/services/modules/teamspeak3/views.py:34
msgid "Activated TeamSpeak3 account."
msgstr "成功激活TeamSpeak3账户"
#: allianceauth/services/modules/teamspeak3/views.py:37
#: allianceauth/services/modules/teamspeak3/views.py:74
#: allianceauth/services/modules/teamspeak3/views.py:100
msgid "An error occurred while processing your TeamSpeak3 account."
msgstr "在处理你的TeamSpeak3账户时发生了错误"
#: allianceauth/services/modules/teamspeak3/views.py:71
msgid "Deactivated TeamSpeak3 account."
msgstr "停用TeamSpeak3账户"
#: allianceauth/services/modules/teamspeak3/views.py:97
msgid "Reset TeamSpeak3 permission key."
msgstr "重置TeamSpeak3授权秘钥"
#: allianceauth/services/modules/xenforo/views.py:30
msgid "Activated XenForo account."
msgstr "成功激活XenForo账户"
#: allianceauth/services/modules/xenforo/views.py:40
#: allianceauth/services/modules/xenforo/views.py:52
#: allianceauth/services/modules/xenforo/views.py:73
#: allianceauth/services/modules/xenforo/views.py:94
msgid "An error occurred while processing your XenForo account."
msgstr "在处理你的XenForo账户时发生了一个错误"
#: allianceauth/services/modules/xenforo/views.py:50
msgid "Deactivated XenForo account."
msgstr "停用XenForo论坛账户"
#: allianceauth/services/modules/xenforo/views.py:65
msgid "Reset XenForo account password."
msgstr "重置XenForo密码"
#: allianceauth/services/modules/xenforo/views.py:91
msgid "Changed XenForo password."
msgstr "修改XenForo密码"
#: allianceauth/services/templates/services/fleetformattertool.html:6
msgid "Fleet Formatter Tool"
msgstr "起队工具"
@@ -1344,7 +1599,7 @@ msgstr "服务"
msgid "Domain"
msgstr "域名"
#: allianceauth/srp/auth_hooks.py:9
#: allianceauth/srp/auth_hooks.py:12
msgid "Ship Replacement"
msgstr "补损"
@@ -1358,7 +1613,7 @@ msgstr "集结时间"
msgid "Fleet Doctrine"
msgstr "舰队船型"
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:89
#: allianceauth/srp/form.py:12 allianceauth/srp/templates/srp/data.html:90
msgid "Additional Info"
msgstr "其他信息"
@@ -1387,63 +1642,63 @@ msgstr "创建补损舰队"
msgid "Give this link to the line members"
msgstr "把这个链接发送给火力狗们"
#: allianceauth/srp/templates/srp/data.html:48
#: allianceauth/srp/templates/srp/data.html:49
msgid "SRP Fleet Data"
msgstr "舰队补损信息"
#: allianceauth/srp/templates/srp/data.html:53
#: allianceauth/srp/templates/srp/data.html:54
msgid "Mark Incomplete"
msgstr "标记为未完成"
#: allianceauth/srp/templates/srp/data.html:57
#: allianceauth/srp/templates/srp/data.html:58
msgid "Mark Completed"
msgstr "标记为已完成"
#: allianceauth/srp/templates/srp/data.html:69
#: allianceauth/srp/templates/srp/data.html:145
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:156
msgid "Total Losses:"
msgstr "损失总额:"
#: allianceauth/srp/templates/srp/data.html:70
#: allianceauth/srp/templates/srp/data.html:146
#: allianceauth/srp/templates/srp/data.html:71
#: allianceauth/srp/templates/srp/data.html:157
#: allianceauth/srp/templates/srp/management.html:30
msgid "Total ISK Cost:"
msgstr "ISK花费总额"
#: allianceauth/srp/templates/srp/data.html:78
#: allianceauth/srp/templates/srp/data.html:154
#: allianceauth/srp/templates/srp/data.html:79
#: allianceauth/srp/templates/srp/data.html:165
msgid "Are you sure you want to delete SRP requests?"
msgstr "老哥,你确定要删了补损请求么?"
#: allianceauth/srp/templates/srp/data.html:87
#: allianceauth/srp/templates/srp/data.html:88
msgid "Pilot Name"
msgstr "玩家ID"
#: allianceauth/srp/templates/srp/data.html:88
#: allianceauth/srp/templates/srp/data.html:89
msgid "Killboard Link"
msgstr "KB网链接"
#: allianceauth/srp/templates/srp/data.html:90
#: allianceauth/srp/templates/srp/data.html:91
msgid "Ship Type"
msgstr "船型"
#: allianceauth/srp/templates/srp/data.html:91
#: allianceauth/srp/templates/srp/data.html:92
msgid "Killboard Loss Amt"
msgstr "KB网总损失"
#: allianceauth/srp/templates/srp/data.html:92
#: allianceauth/srp/templates/srp/data.html:93
msgid "SRP ISK Cost"
msgstr "补损ISK花费"
#: allianceauth/srp/templates/srp/data.html:93
#: allianceauth/srp/templates/srp/data.html:94
msgid "Click value to edit Enter to save & next ESC to cancel"
msgstr "点击数值就可以编辑啦按回车确认按ESC取消"
#: allianceauth/srp/templates/srp/data.html:96
#: allianceauth/srp/templates/srp/data.html:97
msgid "Post Time"
msgstr "发布时间"
#: allianceauth/srp/templates/srp/data.html:163
#: allianceauth/srp/templates/srp/data.html:174
msgid "No SRP requests for this fleet."
msgstr "这次起队没有补损请求!大捷"
@@ -1634,43 +1889,35 @@ msgid "Current"
msgstr "当前版本"
#: allianceauth/templates/allianceauth/admin-status/overview.html:40
msgid "Latest Major"
msgstr "最新主版本号"
msgid "Latest Stable"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:46
#: allianceauth/templates/allianceauth/admin-status/overview.html:56
#: allianceauth/templates/allianceauth/admin-status/overview.html:66
msgid "Update available"
msgstr "有更新!"
#: allianceauth/templates/allianceauth/admin-status/overview.html:50
msgid "Latest Minor"
msgstr "最新小版本号"
#: allianceauth/templates/allianceauth/admin-status/overview.html:51
msgid "Latest Pre-Release"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:60
msgid "Latest Patch"
msgstr "最新补丁版本"
#: allianceauth/templates/allianceauth/admin-status/overview.html:57
msgid "Pre-Release available"
msgstr ""
#: allianceauth/templates/allianceauth/admin-status/overview.html:73
#: allianceauth/templates/allianceauth/admin-status/overview.html:65
msgid "Task Queue"
msgstr "任务队列"
#: allianceauth/templates/allianceauth/admin-status/overview.html:90
#: allianceauth/templates/allianceauth/admin-status/overview.html:82
msgid "Error retrieving task queue length"
msgstr "获取任务队列长度的时候出错啦!"
#: allianceauth/templates/allianceauth/admin-status/overview.html:92
#: allianceauth/templates/allianceauth/admin-status/overview.html:84
#, python-format
msgid "%(tasks)s task"
msgid_plural "%(tasks)s tasks"
msgstr[0] "%(tasks)s个任务"
#: allianceauth/templates/allianceauth/help.html:4
#: allianceauth/templates/allianceauth/help.html:9
#: allianceauth/templates/allianceauth/side-menu.html:34
msgid "Help"
msgstr "帮助"
#: allianceauth/templates/allianceauth/night-toggle.html:3
msgid "Night"
msgstr "暗色皮肤"

View File

@@ -1,5 +1,11 @@
from .models import Notification
from django.core.cache import cache
def user_notification_count(request):
return {'notifications': len(Notification.objects.filter(user__id=request.user.id).filter(viewed=False))}
user_id = request.user.id
notification_count = cache.get("u-note:{}".format(user_id), -1)
if notification_count<0:
notification_count = Notification.objects.filter(user__id=user_id).filter(viewed=False).count()
cache.set("u-note:{}".format(user_id),notification_count,5)
return {'notifications': notification_count}

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% block page_title %}{% trans "Notifications" %}{% endblock %}

Some files were not shown because too many files have changed in this diff Show More