Compare commits

..

22 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
Basraah
aecc94bdb3 Version bump to v2.2.1 2019-08-25 03:20:45 +00:00
Basraah
fcb7f2905a Merge branch 'url_group' into 'master'
urlize group descriptions to hyperlink if required

See merge request allianceauth/allianceauth!1132
2019-08-24 22:48:57 +00:00
Basraah
34c7169ca3 Merge branch 'local_settings_update' into 'master'
Enable utf8mb4 charset option in local.py by default

See merge request allianceauth/allianceauth!1131
2019-08-24 22:47:25 +00:00
Basraah
6e450061f4 Merge branch 'group-rework' into 'master'
Make group joins a bit clearer

See merge request allianceauth/allianceauth!1134
2019-08-24 22:46:46 +00:00
Basraah
fc3d7e9f43 Merge branch 'auto-group' into 'master'
Fix Autogroups, Add Autogroups to admin

Closes #1087

See merge request allianceauth/allianceauth!1133
2019-08-24 22:45:25 +00:00
Aaron Kable
514db4f9a2 Make group joins a bit clearer 2019-08-23 03:54:24 -04:00
Aaron Kable
23a8b65ce2 Fix Autogroups, Add Autogroups to admin 2019-08-22 20:37:55 -04:00
Aaron Kable
f8e6662bc8 urlize group descriptions to hyperlink if required 2019-07-26 00:35:59 -04:00
Col Crunch
89be2456fb Update local.py to have the utf8mb4 charset option enabled in the database settings. This brings the settings inline with the documentation update. 2019-06-30 22:58:13 -04:00
Basraah
bfd3451717 Merge branch 'db_doc' into 'master'
Use utf8mb4 When Creating Auth DB

See merge request allianceauth/allianceauth!1130
2019-06-20 00:49:30 +00:00
Col Crunch
0b759d6a32 Use utf8mb4 when creating auth db rather than utf8 2019-06-19 16:27:18 -04:00
Basraah
65e05084e6 Merge branch 'master' into 'master'
Show "Help" link only to superuser

See merge request allianceauth/allianceauth!1129
2019-06-17 00:56:28 +00:00
Peter Pfeufer
f25a4ed386 Show "Help" lnk only to superuser 2019-06-15 23:44:36 +02:00
Basraah
b2a1d41829 Merge branch 'patch-1' into 'master'
Add Ariel Rin and Col Crunch as developers to readme

See merge request allianceauth/allianceauth!1128
2019-05-29 09:21:51 +00:00
Ariel Rin
3570ce86d7 Add Ariel Rin and Col Crunch as developers to readme 2019-03-17 05:39:43 +00:00
13 changed files with 73 additions and 23 deletions

View File

@@ -19,6 +19,8 @@ Active Developers:
- [Adarnof](https://gitlab.com/adarnof/)
- [Basraah](https://gitlab.com/basraah/)
- [Ariel Rin](https://gitlab.com/soratidus999/)
- [Col Crunch](https://gitlab.com/colcrunch/)
Beta Testers / Bug Fixers:

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.0'
__version__ = '2.2.2'
NAME = 'Alliance Auth v%s' % __version__
default_app_config = 'allianceauth.apps.AllianceAuthConfig'

View File

@@ -1,6 +1,6 @@
from django.contrib import admin
from django.db import models
from .models import AutogroupsConfig
from .models import AutogroupsConfig, ManagedCorpGroup, ManagedAllianceGroup
import logging
@@ -37,3 +37,6 @@ class AutogroupsConfigAdmin(admin.ModelAdmin):
admin.site.register(AutogroupsConfig, AutogroupsConfigAdmin)
admin.site.register(ManagedCorpGroup)
admin.site.register(ManagedAllianceGroup)

View File

@@ -179,15 +179,13 @@ class AutogroupsConfig(models.Model):
@transaction.atomic
def create_alliance_group(self, alliance: EveAllianceInfo) -> Group:
group, created = Group.objects.get_or_create(name=self.get_alliance_group_name(alliance))
if created:
ManagedAllianceGroup.objects.create(group=group, config=self, alliance=alliance)
ManagedAllianceGroup.objects.get_or_create(group=group, config=self, alliance=alliance)
return group
@transaction.atomic
def create_corp_group(self, corp: EveCorporationInfo) -> Group:
group, created = Group.objects.get_or_create(name=self.get_corp_group_name(corp))
if created:
ManagedCorpGroup.objects.create(group=group, config=self, corp=corp)
ManagedCorpGroup.objects.get_or_create(group=group, config=self, corp=corp)
return group
def delete_alliance_managed_groups(self):
@@ -240,6 +238,8 @@ class ManagedGroup(models.Model):
class Meta:
abstract = True
def __str__(self):
return "Managed Group: %s" % self.group.name
class ManagedCorpGroup(ManagedGroup):
corp = models.ForeignKey(EveCorporationInfo, on_delete=models.CASCADE)

View File

@@ -19,7 +19,7 @@ url
{% for g in groups %}
<tr>
<td class="text-center">{{ g.group.name }}</td>
<td class="text-center">{{ g.group.authgroup.description }}</td>
<td class="text-center">{{ g.group.authgroup.description|urlize }}</td>
<td class="text-center">
{% if g.group in user.groups.all %}
{% if not g.request %}
@@ -32,9 +32,15 @@ url
</button>
{% endif %}
{% elif not g.request %}
<a href="{% url 'groupmanagement:request_add' g.group.id %}" class="btn btn-success">
{% trans "Request" %}
</a>
{% if g.group.authgroup.open %}
<a href="{% url 'groupmanagement:request_add' g.group.id %}" class="btn btn-success">
{% trans "Join" %}
</a>
{% else %}
<a href="{% url 'groupmanagement:request_add' g.group.id %}" class="btn btn-primary">
{% trans "Request" %}
</a>
{% endif %}
{% else %}
<button type="button" class="btn btn-primary" disabled>
{{ g.request.status }}

View File

@@ -30,6 +30,7 @@ DATABASES['default'] = {
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '3306',
'OPTIONS': {'charset': 'utf8mb4'},
}
# Register an application at https://developers.eveonline.com for Authentication

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

@@ -27,12 +27,14 @@
{% menu_items %}
<li>
<a class="{% navactive request 'authentication:help' %}"
href="{% url 'authentication:help' %}">
<i class="fa fa-question fa-fw"></i> {% trans "Help" %}
</a>
</li>
{% if user.is_superuser %}
<li>
<a class="{% navactive request 'authentication:help' %}"
href="{% url 'authentication:help' %}">
<i class="fa fa-question fa-fw"></i> {% trans "Help" %}
</a>
</li>
{% endif %}
</ul>
</div>
</div>

View File

@@ -71,7 +71,7 @@ CentOS:
Alliance Auth needs a MySQL user account and database. Open an SQL shell with `mysql -u root -p` and create them as follows, replacing `PASSWORD` with an actual secure password:
CREATE USER 'allianceserver'@'localhost' IDENTIFIED BY 'PASSWORD';
CREATE DATABASE alliance_auth CHARACTER SET utf8;
CREATE DATABASE alliance_auth CHARACTER SET utf8mb4;
GRANT ALL PRIVILEGES ON alliance_auth . * TO 'allianceserver'@'localhost';
Add timezone tables to your mysql installation:

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}