mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-05 06:36:19 +01:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3de7a2ccd2 | ||
|
|
9cc278df31 | ||
|
|
1de3c989d7 | ||
|
|
2e547945e2 | ||
|
|
5b41d0995f | ||
|
|
a7a2ffd16b | ||
|
|
dbeda324e0 | ||
|
|
ee9ed13a66 | ||
|
|
490ce286ff | ||
|
|
099c2c0a21 | ||
|
|
46e15f7fa1 | ||
|
|
6677e63e08 |
41
.gitlab-ci.yml
Normal file
41
.gitlab-ci.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
# Official language image. Look for the different tagged releases at:
|
||||
# https://hub.docker.com/r/library/python/tags/
|
||||
|
||||
.job_template: &job_definition
|
||||
# Change pip's cache directory to be inside the project directory since we can
|
||||
# only cache local items.
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
|
||||
|
||||
# Pip's cache doesn't store the python packages
|
||||
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
|
||||
#
|
||||
# If you want to also cache the installed packages, you have to install
|
||||
# them in a virtualenv and cache it as well.
|
||||
cache:
|
||||
paths:
|
||||
- .cache/pip
|
||||
- venv/
|
||||
|
||||
before_script:
|
||||
- python -V # Print out python version for debugging
|
||||
- pip install virtualenv tox
|
||||
- virtualenv venv
|
||||
- source venv/bin/activate
|
||||
|
||||
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
|
||||
|
||||
|
||||
py36-dj111:
|
||||
<<: *job_definition
|
||||
image: python:3.6-stretch
|
||||
script:
|
||||
- export TOXENV=py36-dj111
|
||||
- tox
|
||||
|
||||
py36-dj20:
|
||||
<<: *job_definition
|
||||
image: python:3.6-stretch
|
||||
script:
|
||||
- export TOXENV=py36-dj20
|
||||
- tox
|
||||
@@ -3,8 +3,9 @@ Alliance Auth
|
||||
|
||||
[](https://gitter.im/R4stl1n/allianceauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](http://allianceauth.readthedocs.io/?badge=latest)
|
||||
[](https://travis-ci.org/allianceauth/allianceauth)
|
||||
[](https://coveralls.io/github/allianceauth/allianceauth?branch=master)
|
||||
[](https://gitlab.com/allianceauth/allianceauth/commits/master)
|
||||
[](https://gitlab.com/allianceauth/allianceauth/commits/master)
|
||||
|
||||
|
||||
|
||||
An auth system for EVE Online to help in-game organizations manage online service access.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# This will make sure the app is always imported when
|
||||
# Django starts so that shared_task will use this app.
|
||||
|
||||
__version__ = '2.0.2'
|
||||
__version__ = '2.0.5'
|
||||
NAME = 'Alliance Auth v%s' % __version__
|
||||
default_app_config = 'allianceauth.apps.AllianceAuthConfig'
|
||||
|
||||
|
||||
@@ -12,6 +12,16 @@ from allianceauth.notifications import notify
|
||||
from allianceauth.corputils.managers import CorpStatsManager
|
||||
|
||||
SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'swagger.json')
|
||||
"""
|
||||
Swagger spec operations:
|
||||
|
||||
Character
|
||||
get_characters_character_id
|
||||
get_corporations_corporation_id_members
|
||||
Universe
|
||||
post_universe_names
|
||||
"""
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -47,11 +57,11 @@ class CorpStats(models.Model):
|
||||
# the swagger spec doesn't have a maxItems count
|
||||
# manual testing says we can do over 350, but let's not risk it
|
||||
member_id_chunks = [member_ids[i:i + 255] for i in range(0, len(member_ids), 255)]
|
||||
member_name_chunks = [c.Character.get_characters_names(character_ids=id_chunk).result() for id_chunk in
|
||||
member_name_chunks = [c.Universe.post_universe_names(ids=id_chunk).result() for id_chunk in
|
||||
member_id_chunks]
|
||||
member_list = {}
|
||||
for name_chunk in member_name_chunks:
|
||||
member_list.update({m['character_id']: m['character_name'] for m in name_chunk})
|
||||
member_list.update({m['id']: m['name'] for m in name_chunk})
|
||||
|
||||
# bulk create new member models
|
||||
missing_members = [m_id for m_id in member_ids if
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -86,7 +86,7 @@ class CorpStatsUpdateTestCase(TestCase):
|
||||
def test_update_add_member(self, SwaggerClient):
|
||||
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.Character.get_characters_names.return_value.result.return_value = [{'character_id': 1, 'character_name': 'test character'}]
|
||||
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())
|
||||
|
||||
@@ -95,7 +95,7 @@ class CorpStatsUpdateTestCase(TestCase):
|
||||
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.Character.get_characters_names.return_value.result.return_value = [{'character_id': 1, 'character_name': 'test character'}]
|
||||
SwaggerClient.from_spec.return_value.Universe.post_universe_names.return_value.result.return_value = [{'id': 1, 'name': 'test character'}]
|
||||
self.corpstats.update()
|
||||
self.assertFalse(CorpMember.objects.filter(character_id='2', corpstats=self.corpstats).exists())
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@ from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo
|
||||
from .models import CorpStats
|
||||
|
||||
SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'swagger.json')
|
||||
"""
|
||||
Swagger spec operations:
|
||||
|
||||
get_characters_character_id
|
||||
"""
|
||||
|
||||
|
||||
def access_corpstats_test(user):
|
||||
|
||||
@@ -4,6 +4,16 @@ import logging
|
||||
import os
|
||||
|
||||
SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'swagger.json')
|
||||
"""
|
||||
Swagger spec operations:
|
||||
|
||||
get_alliances_alliance_id
|
||||
get_alliances_alliance_id_corporations
|
||||
get_corporations_corporation_id
|
||||
get_characters_character_id
|
||||
get_universe_types_type_id
|
||||
"""
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -22,6 +22,16 @@ from allianceauth.eveonline.models import EveCharacter
|
||||
from allianceauth.eveonline.models import EveCorporationInfo
|
||||
|
||||
SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'swagger.json')
|
||||
"""
|
||||
Swagger spec operations:
|
||||
|
||||
get_characters_character_id_location
|
||||
get_characters_character_id_ship
|
||||
get_universe_systems_system_id
|
||||
get_universe_stations_station_id
|
||||
get_universe_structures_structure_id
|
||||
"""
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -194,6 +194,8 @@ LOGIN_TOKEN_SCOPES = ['publicData']
|
||||
# number of days email verification links are valid for
|
||||
ACCOUNT_ACTIVATION_DAYS = 1
|
||||
|
||||
ESI_API_URL = 'https://esi.evetech.net/'
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
{% load i18n %}
|
||||
|
||||
<td class="text-center">Discourse</td>
|
||||
<td class="text-center">{{ char.character_name }}</td>
|
||||
<td class="text-center"><a href="{{ DISCOURSE_URL }}">{{ DISCOURSE_URL }}</a></td>
|
||||
<td class="text-center">
|
||||
<a title="Go To Forums" class="btn btn-success" href="{{ DISCOURSE_URL }}"><span class="glyphicon glyphicon-arrow-right"></span></a>
|
||||
</td>
|
||||
<tr>
|
||||
<td class="text-center">Discourse</td>
|
||||
<td class="text-center">{{ char.character_name }}</td>
|
||||
<td class="text-center"><a href="{{ DISCOURSE_URL }}">{{ DISCOURSE_URL }}</a></td>
|
||||
<td class="text-center">
|
||||
<a title="Go To Forums" class="btn btn-success" href="{{ DISCOURSE_URL }}"><span class="glyphicon glyphicon-arrow-right"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -245,10 +245,10 @@ class Teamspeak3Manager:
|
||||
|
||||
return False
|
||||
|
||||
def generate_new_permissionkey(self, uid, username):
|
||||
def generate_new_permissionkey(self, uid, user, username):
|
||||
logger.debug("Re-issuing permission key for user id %s" % uid)
|
||||
self.delete_user(uid)
|
||||
return self.add_user(username)
|
||||
return self.add_user(user, username)
|
||||
|
||||
def update_groups(self, uid, ts_groups):
|
||||
logger.debug("Updating uid %s TS3 groups %s" % (uid, ts_groups))
|
||||
|
||||
@@ -79,13 +79,12 @@ def reset_teamspeak3_perm(request):
|
||||
logger.debug("reset_teamspeak3_perm called by user %s" % request.user)
|
||||
if not Teamspeak3Tasks.has_account(request.user):
|
||||
return redirect("services:services")
|
||||
character = request.user.profile.main_character
|
||||
logger.debug("Deleting TS3 user for user %s" % request.user)
|
||||
with Teamspeak3Manager() as ts3man:
|
||||
ts3man.delete_user(request.user.teamspeak3.uid)
|
||||
|
||||
logger.debug("Generating new permission key for user %s with main character %s" % (request.user, character))
|
||||
result = ts3man.generate_new_permissionkey(request.user.teamspeak3.uid, character.character_name)
|
||||
logger.debug("Generating new permission key for user %s" % request.user)
|
||||
result = ts3man.generate_new_permissionkey(request.user.teamspeak3.uid, request.user, Teamspeak3Tasks.get_username(request.user))
|
||||
|
||||
# if blank we failed
|
||||
if result[0] != "":
|
||||
|
||||
4
tox.ini
4
tox.ini
@@ -17,4 +17,6 @@ deps=
|
||||
py37: https://github.com/yaml/pyyaml/zipball/master#egg=pyyaml
|
||||
py37: https://github.com/celery/kombu/zipball/master#egg=kombu
|
||||
install_command = pip install -e ".[testing]" -U {opts} {packages}
|
||||
commands=coverage run runtests.py -v 2
|
||||
commands =
|
||||
coverage run runtests.py -v 2
|
||||
coverage report -m
|
||||
|
||||
Reference in New Issue
Block a user