Skip to content

Commit

Permalink
Merge pull request #1427 from liqd/pyup-scheduled-update-2019-03-04
Browse files Browse the repository at this point in the history
Scheduled weekly dependency update for week 09
  • Loading branch information
Magdalena Noffke authored Mar 5, 2019
2 parents dd09135 + f3009a5 commit c2bab8d
Show file tree
Hide file tree
Showing 70 changed files with 382 additions and 375 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
language: python
dist: xenial
python:
- "3.6"
cache: pip
cache:
pip: true
directories:
- node_modules
install:
- nvm install 8
- npm install --production
- npm run build
- pip install -r requirements/dev.txt
- pip install coveralls
script:
- python manage.py collectstatic > /dev/null
- py.test --cov
- python manage.py makemigrations --dry-run --check --noinput
after_success:
Expand Down
2 changes: 1 addition & 1 deletion contrib/translations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.db import models
from django.utils import translation
from wagtail.wagtailcore.models import PageBase
from wagtail.core.models import PageBase

from euth_wagtail.settings import LANGUAGES

Expand Down
2 changes: 1 addition & 1 deletion euth/accounts/views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.contrib.auth import mixins
from django.contrib.messages.views import SuccessMessageMixin
from django.shortcuts import get_object_or_404, redirect
from django.utils.translation import ugettext as _
from django.views import generic
from rules.compat import access_mixins as mixins

from euth.users import models as user_models

Expand Down
8 changes: 4 additions & 4 deletions euth/actions/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class Migration(migrations.Migration):
('public', models.BooleanField(db_index=True, default=True)),
('verb', models.CharField(db_index=True, max_length=255)),
('description', models.TextField(blank=True, null=True)),
('action_object_content_type', models.ForeignKey(blank=True, to='contenttypes.ContentType', related_name='action_object', null=True)),
('actor', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('project', models.ForeignKey(blank=True, to='a4projects.Project', null=True)),
('target_content_type', models.ForeignKey(blank=True, to='contenttypes.ContentType', related_name='target', null=True)),
('action_object_content_type', models.ForeignKey(blank=True, to='contenttypes.ContentType', related_name='action_object', null=True, on_delete=models.CASCADE)),
('actor', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('project', models.ForeignKey(blank=True, to='a4projects.Project', null=True, on_delete=models.CASCADE)),
('target_content_type', models.ForeignKey(blank=True, to='contenttypes.ContentType', related_name='target', null=True, on_delete=models.CASCADE)),
],
),
]
2 changes: 1 addition & 1 deletion euth/actions/migrations/0002_make_user_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='action',
name='actor',
field=models.ForeignKey(blank=True, null=True, to=settings.AUTH_USER_MODEL),
field=models.ForeignKey(blank=True, null=True, to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
]
2 changes: 1 addition & 1 deletion euth/blueprints/templatetags/infopage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
register = template.Library()


@register.assignment_tag
@register.simple_tag
def get_project(helppages, blueprint):
return getattr(helppages, blueprint.type, None)
2 changes: 1 addition & 1 deletion euth/contrib/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ArchivedFilter(filters.DefaultsFilterSet):
}

is_archived = django_filters.BooleanFilter(
name='is_archived',
field_name='is_archived',
widget=ArchivedFilterWidget
)

Expand Down
2 changes: 1 addition & 1 deletion euth/contrib/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class TimezoneMiddleware(MiddlewareMixin):

def process_request(self, request):
if request.user.is_authenticated() and request.user.timezone:
if request.user.is_authenticated and request.user.timezone:
timezone.activate(pytz.timezone(request.user.timezone))
else:
timezone.deactivate()
26 changes: 13 additions & 13 deletions euth/contrib/oembed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,54 @@
oembed_providers = ProviderRegistry(cache)

oembed_providers.register(
'http://\S*imgur\.com/\S+',
r'http://\S*imgur\.com/\S+',
Provider('http://api.imgur.com/oembed')
),
oembed_providers.register(
'https?://\S*?flickr.com/\S+',
r'https?://\S*?flickr.com/\S+',
Provider('https://www.flickr.com/services/oembed/')
)
oembed_providers.register(
'https?://flic\.kr/\S*',
r'https?://flic\.kr/\S*',
Provider('https://www.flickr.com/services/oembed/')
)
oembed_providers.register(
'http://i\S*.photobucket.com/albums/\S+',
r'http://i\S*.photobucket.com/albums/\S+',
Provider('http://photobucket.com/oembed')
)
oembed_providers.register(
'http://gi\S*.photobucket.com/groups/\S+',
r'http://gi\S*.photobucket.com/groups/\S+',
Provider('http://photobucket.com/oembed')
)
oembed_providers.register(
'https://\S*?soundcloud.com/\S+',
r'https://\S*?soundcloud.com/\S+',
Provider('http://soundcloud.com/oembed')
)
oembed_providers.register(
'http://vimeo.com/\S+',
r'http://vimeo.com/\S+',
Provider('http://vimeo.com/api/oembed.json')
)
oembed_providers.register(
'https://vimeo.com/\S+',
r'https://vimeo.com/\S+',
Provider('https://vimeo.com/api/oembed.json')
)
oembed_providers.register(
'http://(\S*.)?youtu(\.be/|be\.com/watch)\S+',
r'http://(\S*.)?youtu(\.be/|be\.com/watch)\S+',
Provider('http://www.youtube.com/oembed')
)
oembed_providers.register(
'https://(\S*.)?youtu(\.be/|be\.com/watch)\S+',
r'https://(\S*.)?youtu(\.be/|be\.com/watch)\S+',
Provider('http://www.youtube.com/oembed?scheme=https&')
)
oembed_providers.register(
'https?://www.instagr(\.am|am\.com)/p/\S+',
r'https?://www.instagr(\.am|am\.com)/p/\S+',
Provider('http://api.instagram.com/oembed')
)
oembed_providers.register(
'https?://www.facebook.com/\S+/videos/\S+',
r'https?://www.facebook.com/\S+/videos/\S+',
Provider('https://www.facebook.com/plugins/video/oembed.json')
)
oembed_providers.register(
'https?://www.facebook.com/video.php\?(id|v)=\S+',
r'https?://www.facebook.com/video.php\?(id|v)=\S+',
Provider('https://www.facebook.com/plugins/video/oembed.json')
)
4 changes: 2 additions & 2 deletions euth/contrib/templatetags/contrib_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
register = template.Library()


@register.assignment_tag
@register.simple_tag
def combined_url_parameter(request_query_dict, **kwargs):
combined_query_dict = request_query_dict.copy()
for key in kwargs:
Expand All @@ -12,7 +12,7 @@ def combined_url_parameter(request_query_dict, **kwargs):
return encoded_parameter


@register.assignment_tag
@register.simple_tag
def limited_paginator(page_obj):
ADDITIONAL_PAGES = 3

Expand Down
2 changes: 1 addition & 1 deletion euth/contrib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Media:
input_type = 'text'
format_index = 0

def render(self, name, value, attrs=None):
def render(self, name, value, attrs=None, renderer=None):
if attrs:
format = formats.get_format(
self.format_key
Expand Down
4 changes: 2 additions & 2 deletions euth/dashboard/mixins.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.auth import mixins
from django.shortcuts import get_object_or_404
from django.utils import functional
from django.views import generic
from rules.compat import access_mixins as mixins

from adhocracy4.projects import models as project_models
from euth.organisations import models as org_models
Expand Down Expand Up @@ -36,4 +36,4 @@ def other_organisations_of_user(self):

@property
def raise_exception(self):
return self.request.user.is_authenticated()
return self.request.user.is_authenticated
10 changes: 5 additions & 5 deletions euth/dashboard/templatetags/form_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
register = template.Library()


@register.assignment_tag
@register.simple_tag
def add(number1, number2):
return number1 + number2


@register.assignment_tag
@register.simple_tag
def next(some_list, current_index):
try:
return some_list[int(current_index) + 1]
except (IndexError, TypeError, ValueError):
return ''


@register.assignment_tag
@register.simple_tag
def getPhaseName(type):
name = phases.content.__getitem__(type).name
return name


@register.assignment_tag
@register.simple_tag
def getAllowedFileTypes():
fileformats = settings.FILE_ALIASES['*']['fileformats']
return ', '.join([name for name, mimetype in fileformats])


@register.assignment_tag
@register.simple_tag
def get_disabled(project):
return 'disabled' if project and project.is_archived else ''
4 changes: 2 additions & 2 deletions euth/documents/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Document',
fields=[
('item_ptr', models.OneToOneField(auto_created=True, primary_key=True, to='a4modules.Item', serialize=False, parent_link=True)),
('item_ptr', models.OneToOneField(auto_created=True, primary_key=True, to='a4modules.Item', serialize=False, parent_link=True, on_delete=models.CASCADE)),
('name', models.CharField(max_length=120)),
],
options={
Expand All @@ -33,7 +33,7 @@ class Migration(migrations.Migration):
('name', models.CharField(blank=True, max_length=120)),
('text', ckeditor.fields.RichTextField()),
('weight', models.PositiveIntegerField()),
('document', models.ForeignKey(to='euth_documents.Document')),
('document', models.ForeignKey(to='euth_documents.Document', on_delete=models.CASCADE)),
],
options={
'abstract': False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='paragraph',
name='document',
field=models.ForeignKey(to='euth_documents.Document', related_name='paragraphs'),
field=models.ForeignKey(to='euth_documents.Document', related_name='paragraphs', on_delete=models.CASCADE),
),
]
2 changes: 1 addition & 1 deletion euth/documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ class ParagraphDetailView(PermissionRequiredMixin, generic.DetailView):

@property
def raise_exception(self):
return self.request.user.is_authenticated()
return self.request.user.is_authenticated
7 changes: 4 additions & 3 deletions euth/follows/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from rest_framework import filters, mixins, permissions, viewsets
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import mixins, permissions, viewsets

from euth.contrib.api.mixins import AllowPUTAsCreateMixin

Expand All @@ -16,8 +17,8 @@ class FollowViewSet(AllowPUTAsCreateMixin,
queryset = models.Follow.objects
serializer_class = FollowSerializer
permission_classes = (permissions.IsAuthenticated,)
filter_backends = (filters.DjangoFilterBackend,)
filter_fields = ('enabled', )
filter_backends = (DjangoFilterBackend,)
filterset_fields = ('enabled', )

def get_queryset(self):
return self.queryset.filter(creator=self.request.user)
4 changes: 2 additions & 2 deletions euth/follows/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Migration(migrations.Migration):
('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('modified', models.DateTimeField(blank=True, null=True, editable=False)),
('enabled', models.BooleanField(default=True)),
('creator', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('project', models.ForeignKey(to='a4projects.Project')),
('creator', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('project', models.ForeignKey(to='a4projects.Project', on_delete=models.CASCADE)),
],
),
migrations.AlterUniqueTogether(
Expand Down
4 changes: 2 additions & 2 deletions euth/follows/templatetags/follow_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
register = template.Library()


@register.assignment_tag()
@register.simple_tag()
def is_following(user, project):
return (
user.is_authenticated() and
user.is_authenticated and
models.Follow.objects.filter(
enabled=True,
project=project,
Expand Down
2 changes: 1 addition & 1 deletion euth/ideas/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Idea',
fields=[
('item_ptr', models.OneToOneField(to='a4modules.Item', parent_link=True, serialize=False, auto_created=True, primary_key=True)),
('item_ptr', models.OneToOneField(to='a4modules.Item', parent_link=True, serialize=False, auto_created=True, primary_key=True, on_delete=models.CASCADE)),
('slug', autoslug.fields.AutoSlugField(unique=True, editable=False, populate_from='name')),
('name', models.CharField(max_length=120)),
('description', ckeditor.fields.RichTextField()),
Expand Down
4 changes: 2 additions & 2 deletions euth/ideas/templatetags/idea_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
register = template.Library()


@register.assignment_tag
@register.simple_tag
def get_range(number, listcount):
if number < 3:
return range(1, 6)
Expand All @@ -15,6 +15,6 @@ def get_range(number, listcount):
return range(number-2, number+3)


@register.assignment_tag
@register.simple_tag
def is_idea_list(module):
return Idea.objects.filter(module=module).count() > 0
8 changes: 4 additions & 4 deletions euth/ideas/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IdeaDetailView(PermissionRequiredMixin, generic.DetailView):

@property
def raise_exception(self):
return self.request.user.is_authenticated()
return self.request.user.is_authenticated

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
Expand All @@ -52,7 +52,7 @@ class IdeaUpdateView(PermissionRequiredMixin, generic.UpdateView):

@property
def raise_exception(self):
return self.request.user.is_authenticated()
return self.request.user.is_authenticated

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
Expand All @@ -73,7 +73,7 @@ class IdeaCreateView(PermissionRequiredMixin, generic.CreateView):

@property
def raise_exception(self):
return self.request.user.is_authenticated()
return self.request.user.is_authenticated

def dispatch(self, *args, **kwargs):
mod_slug = self.kwargs[self.slug_url_kwarg]
Expand Down Expand Up @@ -109,7 +109,7 @@ class IdeaDeleteView(PermissionRequiredMixin, generic.DeleteView):

@property
def raise_exception(self):
return self.request.user.is_authenticated()
return self.request.user.is_authenticated

def delete(self, request, *args, **kwargs):
messages.success(self.request, self.success_message)
Expand Down
4 changes: 2 additions & 2 deletions euth/maps/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('polygon', euth.maps.fields.MultiPolygonField()),
('module', models.OneToOneField(to='a4modules.Module', related_name='areasettings_settings')),
('module', models.OneToOneField(to='a4modules.Module', related_name='areasettings_settings', on_delete=models.CASCADE)),
],
options={
'abstract': False,
Expand All @@ -27,7 +27,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='MapIdea',
fields=[
('idea_ptr', models.OneToOneField(serialize=False, auto_created=True, primary_key=True, parent_link=True, to='euth_ideas.Idea')),
('idea_ptr', models.OneToOneField(serialize=False, auto_created=True, primary_key=True, parent_link=True, to='euth_ideas.Idea', on_delete=models.CASCADE)),
('point', euth.maps.fields.PointField()),
],
options={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='areasettings',
name='module',
field=models.OneToOneField(related_name='areasettings_settings_legacy', to='a4modules.Module'),
field=models.OneToOneField(related_name='areasettings_settings_legacy', to='a4modules.Module', on_delete=models.CASCADE),
),
]
Loading

0 comments on commit c2bab8d

Please sign in to comment.