Compare commits

..

7 Commits

Author SHA1 Message Date
Basraah
debd6ef2b9 Version bump to v2.2.2 2019-12-05 02:37:22 +00:00
Basraah
58e9c21e4f Merge branch 'issue-1176' into 'master'
Fix issue #1176: Prevent Django 3 installation

Closes #1176

See merge request allianceauth/allianceauth!1142
2019-12-05 02:36:03 +00:00
ErikKalkoken
c7c3083e3e Fix issue #1176: Prevent Django 3 installation 2019-12-04 14:02:03 +01:00
Basraah
63d061e9f2 Merge branch 'bug-1165' into 'master'
add fix and unittest for issue #1165

See merge request allianceauth/allianceauth!1137
2019-09-12 09:53:05 +00:00
ErikKalkoken
1887bdb90a add fix and unittest for issue #1165 2019-09-08 23:09:20 +02:00
Basraah
69addb068a Merge branch 'patch-3' into 'master'
Add discord warning for tasks

See merge request allianceauth/allianceauth!1136
2019-08-30 03:22:49 +00:00
Aaron Kable
a62c3ce0f9 Add discord warning for tasks 2019-08-30 03:22:49 +00:00
6 changed files with 43 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
__version__ = '2.2.1'
__version__ = '2.2.2'
NAME = 'Alliance Auth v%s' % __version__
default_app_config = 'allianceauth.apps.AllianceAuthConfig'

View File

@@ -199,7 +199,7 @@ class Teamspeak3Manager:
'tokendescription': username_clean,
'tokencustomset': "ident=sso_uid value=%s" % username_clean})
except TeamspeakError as e:
logger.error("Failed to add teamspeak user %s: %s" % (username, str(e)))
logger.error("Failed to add teamspeak user %s: %s" % (username_clean, str(e)))
return "",""
try:

View File

@@ -12,6 +12,10 @@ from .models import Teamspeak3User, AuthTS, TSgroup, StateGroup
from .tasks import Teamspeak3Tasks
from .signals import m2m_changed_authts_group, post_save_authts, post_delete_authts
from .manager import Teamspeak3Manager
from .util.ts3 import TeamspeakError
from allianceauth.authentication.models import State
MODULE_PATH = 'allianceauth.services.modules.teamspeak3'
DEFAULT_AUTH_GROUP = 'Member'
@@ -290,3 +294,31 @@ class Teamspeak3SignalsTestCase(TestCase):
self.member.profile.save()
self.assertTrue(update_groups.called)
class Teamspeak3ManagerTestCase(TestCase):
@staticmethod
def my_side_effect(*args, **kwargs):
raise TeamspeakError(1)
@mock.patch.object(Teamspeak3Manager, '_group_list')
@mock.patch.object(Teamspeak3Manager, '_group_id_by_name')
def test_add_user_exception(self, _group_id_by_name, _group_list):
"""test 1st exception occuring in add_user()"""
# set mocks in Teamspeak3Manager class
_group_list.return_value = ['Member', 'Guest']
_group_id_by_name.return_value = 99
manager = Teamspeak3Manager()
server = mock.MagicMock()
server._connected.return_value = True
server.send_command = mock.Mock(side_effect=Teamspeak3ManagerTestCase.my_side_effect)
manager._server = server
# create test data
user = User.objects.create_user("dummy")
user.profile.state = State.objects.filter(name="Member").first()
# perform test
manager.add_user(user, "Dummy User")

View File

@@ -6,6 +6,11 @@ Discord is very popular amongst ad-hoc small groups and larger organizations see
## Setup
```eval_rst
.. warning::
Do not run the `discord.update_*` periodic tasks on a regular schedule, doing so can cause your discord service to stop syncing completely.
```
### Prepare Your Settings File
In your auth project's settings file, do the following:
- Add `'allianceauth.services.modules.discord',` to your `INSTALLED_APPS` list

View File

@@ -16,7 +16,7 @@ install_requires = [
'celery>=4.0.2,<4.3.0',
'celery_once',
'django>=2.0',
'django>=2.0,<3.0',
'django-bootstrap-form',
'django-registration==2.4',
'django-sortedm2m',

View File

@@ -1,7 +1,7 @@
[tox]
skipsdist = True
usedevelop = True
envlist = py{34,35,36,37}-dj{111,20}
envlist = py{34,35,36,37}-dj{20}
[testenv]
setenv =
@@ -11,9 +11,8 @@ basepython =
py35: python3.5
py36: python3.6
py37: python3.7
deps=
dj111: Django>=1.11.1,<2.0
dj20: Django>=2.0
deps=
dj20: Django>=2.0,<3.0
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}