Resolve Dj20 compatibility issues

Temporarily use latest snapshot for esi for dj20

    Correct admin urls include

    Manually correct old ts3 table migration

    Remove obsolete services migrations

    Remove bootstrap pagination package

    Fix url namespacing
This commit is contained in:
Basraah 2017-09-28 14:47:06 +10:00
parent 51e4db73f0
commit 8864afd784
28 changed files with 50 additions and 126 deletions

View File

@ -27,7 +27,6 @@ INSTALLED_APPS = [
'django.contrib.humanize',
'django_celery_beat',
'bootstrapform',
'bootstrap_pagination',
'sortedm2m',
'esi',
'allianceauth',

View File

@ -6,7 +6,7 @@ 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.core.urlresolvers import reverse
from django.urls import reverse
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from esi.decorators import token_required

View File

@ -2,7 +2,6 @@
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}
{% load bootstrap_pagination %}
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}{% trans "Fatlink view" %}{% endblock page_title %}
@ -20,9 +19,6 @@
<div class="panel panel-default">
<div class="panel-heading">{% trans "Registered characters" %}</div>
<div class="panel-body">
<div class="text-center">
{% bootstrap_paginate registered_fats range=10 %}
</div>
<table class="table table-responsive table-hover">
<tr>
<th class="text-center">{% trans "User" %}</th>

View File

@ -29,19 +29,6 @@ SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sw
logger = logging.getLogger(__name__)
FATS_PER_PAGE = int(getattr(settings, 'FATS_PER_PAGE', 20))
def get_page(model_list, page_num):
p = Paginator(model_list, FATS_PER_PAGE)
try:
fats = p.page(page_num)
except PageNotAnInteger:
fats = p.page(1)
except EmptyPage:
fats = p.page(p.num_pages)
return fats
class CorpStat(object):
def __init__(self, corp_id, start_of_month, start_of_next_month, corp=None):
@ -359,8 +346,6 @@ def modify_fatlink_view(request, hash=""):
registered_fats = Fat.objects.filter(fatlink=fatlink).order_by('character__character_name')
fat_page = get_page(registered_fats, request.GET.get('page', 1))
context = {'fatlink': fatlink, 'registered_fats': fat_page}
context = {'fatlink': fatlink, 'registered_fats': registered_fats}
return render(request, 'fleetactivitytracking/fatlinkmodify.html', context=context)

View File

@ -1,38 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-05 21:40
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_length'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='DiscordAuthToken',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('email', models.CharField(max_length=254, unique=True)),
('token', models.CharField(max_length=254)),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='GroupCache',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True)),
('groups', models.TextField(default={})),
('service', models.CharField(choices=[(b'discourse', b'discourse'), (b'discord', b'discord')], max_length=254, unique=True)),
],
),
]

View File

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-16 01:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('services', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='discordauthtoken',
name='user',
),
migrations.DeleteModel(
name='DiscordAuthToken',
),
]

View File

@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-09-02 06:07
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('services', '0002_auto_20161016_0135'),
]
operations = [
migrations.DeleteModel(
name='GroupCache',
),
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'discord'
module_urls = [
# Discord Service Control
url(r'^activate/$', views.activate_discord, name='activate'),
@ -12,5 +14,5 @@ module_urls = [
]
urlpatterns = [
url(r'^discord/', include(module_urls, namespace='discord'))
url(r'^discord/', include((module_urls, app_name), namespace=app_name))
]

View File

@ -1,9 +1,11 @@
from django.conf.urls import url, include
app_name = 'example'
module_urls = [
# Add your module URLs here
]
urlpatterns = [
url(r'^example/', include(module_urls, namespace='example')),
url(r'^example/', include((module_urls, app_name), namespace=app_name)),
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'ips4'
module_urls = [
# IPS4 Service Control
url(r'^activate/$', views.activate_ips4, name='activate'),
@ -11,5 +13,5 @@ module_urls = [
]
urlpatterns = [
url(r'^ips4/', include(module_urls, namespace='ips4'))
url(r'^ips4/', include((module_urls, app_name), namespace=app_name))
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'evernusmarket'
module_urls = [
# Alliance Market Control
url(r'^activate/$', views.activate_market, name='activate'),
@ -11,5 +13,5 @@ module_urls = [
]
urlpatterns = [
url(r'^evernus-market/', include(module_urls, namespace='evernusmarket'))
url(r'^evernus-market/', include((module_urls, app_name), namespace=app_name))
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'mumble'
module_urls = [
# Mumble service control
url(r'^activate/$', views.activate_mumble, name='activate'),
@ -12,5 +14,5 @@ module_urls = [
]
urlpatterns = [
url(r'^mumble/', include(module_urls, namespace='mumble'))
url(r'^mumble/', include((module_urls, app_name), namespace=app_name))
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'openfire'
module_urls = [
# Jabber Service Control
url(r'^activate/$', views.activate_jabber, name='activate'),
@ -12,5 +14,5 @@ module_urls = [
]
urlpatterns = [
url(r'^openfire/', include(module_urls, namespace='openfire')),
url(r'^openfire/', include((module_urls, app_name), namespace=app_name)),
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'phpbb3'
module_urls = [
# Forum Service Control
url(r'^activate/$', views.activate_forum, name='activate'),
@ -11,5 +13,5 @@ module_urls = [
]
urlpatterns = [
url(r'^phpbb3/', include(module_urls, namespace='phpbb3'))
url(r'^phpbb3/', include((module_urls, app_name), namespace=app_name))
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name='seat'
module_urls = [
# SeAT Service Control
url(r'^activate/$', views.activate_seat, name='activate'),
@ -11,5 +13,5 @@ module_urls = [
]
urlpatterns = [
url(r'^seat/', include(module_urls, namespace='seat')),
url(r'^seat/', include((module_urls, app_name), namespace=app_name)),
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'smf'
module_urls = [
# SMF Service Control
url(r'^activate/$', views.activate_smf, name='activate'),
@ -11,5 +13,5 @@ module_urls = [
]
urlpatterns = [
url(r'^smf/', include(module_urls, namespace='smf')),
url(r'^smf/', include((module_urls, app_name), namespace=app_name)),
]

View File

@ -24,7 +24,7 @@ class Migration(migrations.Migration):
('auth_group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.Group')),
],
options={
'db_table': 'services_authts',
'db_table': 'teamspeak3_authts',
'verbose_name': 'Auth / TS Group',
},
),
@ -35,7 +35,7 @@ class Migration(migrations.Migration):
('ts_group_name', models.CharField(max_length=30)),
],
options={
'db_table': 'services_tsgroup',
'db_table': 'teamspeak3_tsgroup',
'verbose_name': 'TS Group',
},
),
@ -47,7 +47,7 @@ class Migration(migrations.Migration):
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'services_usertsgroup',
'db_table': 'teamspeak3_usertsgroup',
'verbose_name': 'User TS Group',
},
),

View File

@ -1,8 +1,9 @@
from django.db import models
from django.contrib.auth.models import User, Group
class Teamspeak3User(models.Model):
user = models.OneToOneField('auth.User',
user = models.OneToOneField(User,
primary_key=True,
on_delete=models.CASCADE,
related_name='teamspeak3')
@ -30,7 +31,7 @@ class TSgroup(models.Model):
class AuthTS(models.Model):
auth_group = models.ForeignKey('auth.Group', on_delete=models.CASCADE)
auth_group = models.ForeignKey(Group, on_delete=models.CASCADE)
ts_group = models.ManyToManyField(TSgroup)
class Meta:
@ -41,7 +42,7 @@ class AuthTS(models.Model):
class UserTSgroup(models.Model):
user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
ts_group = models.ManyToManyField(TSgroup)
class Meta:

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'teamspeak3'
module_urls = [
# Teamspeak3 service control
url(r'^activate/$', views.activate_teamspeak3,
@ -16,5 +18,5 @@ module_urls = [
]
urlpatterns = [
url(r'^teamspeak3/', include(module_urls, namespace='teamspeak3')),
url(r'^teamspeak3/', include((module_urls, app_name), namespace=app_name)),
]

View File

@ -2,6 +2,8 @@ from django.conf.urls import url, include
from . import views
app_name = 'xenforo'
module_urls = [
# XenForo service control
url(r'^activate/$', views.activate_xenforo_forum, name='activate'),
@ -11,5 +13,5 @@ module_urls = [
]
urlpatterns = [
url(r'^xenforo/', include(module_urls, namespace='xenforo')),
url(r'^xenforo/', include((module_urls, app_name), namespace=app_name)),
]

View File

@ -5,11 +5,11 @@ from . import views
urlpatterns = [
# Services
url(r'^services/', include([
url(r'^services/', include(([
url(r'^$', views.services_view, name='services'),
# Tools
url(r'^tool/fleet_formatter_tool/$', views.fleet_formatter_view, name='fleet_format_tool'),
], namespace='services')),
], 'services'), namespace='services')),
]
# Append hooked service urls

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
from django.template import Library
from django.core.urlresolvers import resolve
from django.urls import resolve
from django.conf import settings
import re

View File

@ -1,6 +1,6 @@
from django_webtest import WebTest
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.contrib.auth.models import Permission, User
from django.conf import settings

View File

@ -23,15 +23,15 @@ urlpatterns = [
url(r'^i18n/', include('django.conf.urls.i18n')),
# Authentication
url(r'', include(allianceauth.authentication.urls, namespace='authentication')),
url(r'', include(allianceauth.authentication.urls)),
url(r'^account/login/$', TemplateView.as_view(template_name='public/login.html'), name='auth_login_user'),
url(r'account/', include(hmac_urls)),
# Admin urls
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/', admin.site.urls),
# SSO
url(r'^sso/', include(esi.urls, namespace='esi')),
url(r'^sso/', include((esi.urls, 'esi'), namespace='esi')),
url(r'^sso/login$', allianceauth.authentication.views.sso_login, name='auth_sso_login'),
# Notifications

View File

@ -16,7 +16,6 @@ install_requires = [
'django>=1.11',
'django-bootstrap-form',
'django-bootstrap-pagination',
'django-registration',
'django-sortedm2m',
'django-redis-cache>=1.7.1',

View File

@ -40,7 +40,6 @@ INSTALLED_APPS = [
'django_celery_beat',
'bootstrapform',
'esi',
'bootstrap_pagination',
'allianceauth',
'allianceauth.authentication',
'allianceauth.services',

View File

@ -15,5 +15,6 @@ deps=
dj111: Django>=1.11.1,<2.0
dj20: Django>=2.0a1
dj20: https://github.com/celery/django-celery-beat/zipball/master#egg=django-celery-beat
dj20: https://github.com/Adarnof/adarnauth-esi/zipball/master#egg=adarnauth-esi
install_command = pip install -e ".[testing]" -U {opts} {packages}
commands=coverage run runtests.py -v 2