Merge remote-tracking branch 'origin/master'
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 4m55s
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 4m55s
This commit is contained in:
@@ -1 +0,0 @@
|
||||
default_app_config = 'dav_events.apps.AppConfig' # pylint: disable=invalid-name
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_countries import Countries
|
||||
|
||||
CHOICE_FIELD_MAX_LENGTH = 25
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from dav_events.config import FieldInitial
|
||||
|
||||
# E-Mails
|
||||
|
||||
@@ -6,7 +6,7 @@ import re
|
||||
from babel.dates import format_date
|
||||
from django import forms
|
||||
from django.apps import apps
|
||||
from django.utils.translation import get_language, ugettext, ugettext_lazy as _
|
||||
from django.utils.translation import get_language, gettext, gettext_lazy as _
|
||||
from django_countries.fields import Country, LazyTypedChoiceField
|
||||
from datetimewidget.widgets import DateWidget, TimeWidget, DateTimeWidget
|
||||
from six import string_types
|
||||
@@ -840,7 +840,7 @@ class ChargesForm(EventCreateForm):
|
||||
|
||||
additional_costs_text = u''
|
||||
if transport != 'coach':
|
||||
additional_costs_text += ugettext(u'Fahrtkosten')
|
||||
additional_costs_text += gettext(u'Fahrtkosten')
|
||||
if transport == 'public':
|
||||
pubtrans_planned = True
|
||||
else:
|
||||
@@ -852,7 +852,7 @@ class ChargesForm(EventCreateForm):
|
||||
if accommodation != 'NONE':
|
||||
if additional_costs_text:
|
||||
additional_costs_text += u', '
|
||||
additional_costs_text += ugettext(u'Unterkunft und Verpflegung')
|
||||
additional_costs_text += gettext(u'Unterkunft und Verpflegung')
|
||||
else:
|
||||
ndays = 1
|
||||
|
||||
@@ -901,10 +901,10 @@ class ChargesForm(EventCreateForm):
|
||||
self.fields['trainer1_reward'].initial = trainer1_reward
|
||||
self.fields['trainer23_reward'].initial = trainer23_reward
|
||||
|
||||
self.fields['pubtrans_bonus'].widget.attrs['title'] = ugettext(u'Der Bonus wird nachträglich'
|
||||
u' auf Meldung der Tourenleitung'
|
||||
u' verrechnet und ist noch nicht'
|
||||
u' in den hier dargestellten Zahlen enthalten.')
|
||||
self.fields['pubtrans_bonus'].widget.attrs['title'] = gettext(u'Der Bonus wird nachträglich'
|
||||
u' auf Meldung der Tourenleitung'
|
||||
u' verrechnet und ist noch nicht'
|
||||
u' in den hier dargestellten Zahlen enthalten.')
|
||||
self.fields['charge'].widget.attrs['title'] = (u'%d € Beitrag \n'
|
||||
u'+ %d Tage * %d € täglicher Beitrag \n'
|
||||
u'+ %d halben Anreisetag * %d € halbtäglicher Beitrag'
|
||||
@@ -941,7 +941,7 @@ class ChargesForm(EventCreateForm):
|
||||
)
|
||||
)
|
||||
|
||||
self.fields['additional_costs'].widget.attrs['placeholder'] = ugettext(u'Kann freigelassen werden')
|
||||
self.fields['additional_costs'].widget.attrs['placeholder'] = gettext(u'Kann freigelassen werden')
|
||||
self.fields['additional_costs'].initial = additional_costs_text
|
||||
|
||||
|
||||
@@ -1011,32 +1011,32 @@ class DescriptionForm(EventCreateForm):
|
||||
if mode == 'training':
|
||||
# Titelprefix für Kurse
|
||||
if level == 'family':
|
||||
value += u'%s' % ugettext(u'Familienkurs')
|
||||
value += u'%s' % gettext(u'Familienkurs')
|
||||
elif level == 'beginner':
|
||||
value += u'%s' % ugettext(u'Grundkurs')
|
||||
value += u'%s' % gettext(u'Grundkurs')
|
||||
else:
|
||||
value += u'%s' % ugettext(u'Aufbaukurs')
|
||||
value += u'%s' % gettext(u'Aufbaukurs')
|
||||
|
||||
if sport == 'B':
|
||||
value += u' %s' % ugettext(u'Alpin')
|
||||
value += u' %s' % gettext(u'Alpin')
|
||||
elif sport == 'K':
|
||||
if terrain == 'gym':
|
||||
value += u' %s' % ugettext(u'Indoorklettern')
|
||||
value += u' %s' % gettext(u'Indoorklettern')
|
||||
elif terrain == 'crag':
|
||||
value += u' %s' % ugettext(u'Fels')
|
||||
value += u' %s' % gettext(u'Fels')
|
||||
elif terrain == 'alpine':
|
||||
value += u' %s' % ugettext(u'Alpinklettern')
|
||||
value += u' %s' % gettext(u'Alpinklettern')
|
||||
|
||||
value += u': ...'
|
||||
elif sport == 'W':
|
||||
# Titelprefix für Wanderungen
|
||||
if level == 'family':
|
||||
value += u'%s ...' % ugettext(u'Familienwanderung')
|
||||
value += u'%s ...' % gettext(u'Familienwanderung')
|
||||
elif not last_day:
|
||||
value += u'%s ...' % ugettext(u'Tageswanderung')
|
||||
value += u'%s ...' % gettext(u'Tageswanderung')
|
||||
elif level == 'family':
|
||||
# Titelprefix für sonstige Familientouren
|
||||
value += u'%s: ...' % ugettext(u'Familientour')
|
||||
value += u'%s: ...' % gettext(u'Familientour')
|
||||
|
||||
if app_config.settings.forms_development_init:
|
||||
if not value:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class RegistrationResponseForm(forms.Form):
|
||||
|
||||
@@ -13,7 +13,7 @@ from django.contrib.auth import get_user_model
|
||||
from django.urls import reverse
|
||||
from django.db import models
|
||||
from django.template.loader import get_template
|
||||
from django.utils.translation import get_language, ugettext_lazy as _
|
||||
from django.utils.translation import get_language, gettext_lazy as _
|
||||
from django_countries.fields import Country, CountryField
|
||||
|
||||
from .. import choices
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from ..validators import IdStringValidator
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.contrib.auth import get_user_model
|
||||
from django.urls import reverse
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext, ugettext_lazy as _
|
||||
from django.utils.translation import gettext, gettext_lazy as _
|
||||
|
||||
from .event import Event
|
||||
|
||||
@@ -51,7 +51,7 @@ class OneClickAction(models.Model):
|
||||
if self.done and not self.allow_repeat:
|
||||
result['context'] = {
|
||||
'status': 'warning',
|
||||
'message': ugettext('Diese Aktion hast du bereits ausgeführt.'),
|
||||
'message': gettext('Diese Aktion hast du bereits ausgeführt.'),
|
||||
}
|
||||
return result
|
||||
|
||||
@@ -78,17 +78,17 @@ class OneClickAction(models.Model):
|
||||
|
||||
flag = event.flags.filter(status__code=status_code).first()
|
||||
if flag:
|
||||
message = (ugettext('Der Status wurde bereits'
|
||||
' am %(date)s'
|
||||
' von %(user)s'
|
||||
' auf \'%(status)s\' gesetzt.') % {
|
||||
message = (gettext('Der Status wurde bereits'
|
||||
' am %(date)s'
|
||||
' von %(user)s'
|
||||
' auf \'%(status)s\' gesetzt.') % {
|
||||
'status': flag.status.label,
|
||||
'date': timezone.localtime(flag.timestamp).strftime('%d.%m.%Y %H:%M:%S'),
|
||||
'user': flag.user.get_full_name(),
|
||||
})
|
||||
else:
|
||||
flag = event.workflow.update_status(status_code, user)
|
||||
message = (ugettext('Der Status wurde auf \'%(status)s\' gesetzt.') %
|
||||
message = (gettext('Der Status wurde auf \'%(status)s\' gesetzt.') %
|
||||
{'status': flag.status.label})
|
||||
|
||||
result['context'] = {
|
||||
@@ -109,7 +109,7 @@ class OneClickAction(models.Model):
|
||||
else:
|
||||
result['context'] = {
|
||||
'status': 'danger',
|
||||
'message': ugettext('Invalid Command. Code on fire!'),
|
||||
'message': gettext('Invalid Command. Code on fire!'),
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
@@ -4,7 +4,7 @@ import datetime
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from dav_base.validators import DAVNumberValidator
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from ..participant import AbstractParticipant
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"url_prefix": "events"
|
||||
"url_prefix": "events",
|
||||
"app_config": ".apps.AppConfig"
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
from django.dispatch import Signal
|
||||
|
||||
event_created = Signal(providing_args=['event'])
|
||||
event_updated = Signal(providing_args=['event', 'diff', 'user'])
|
||||
event_status_updated = Signal(providing_args=['event', 'flag'])
|
||||
event_registration_closed = Signal(providing_args=['event', 'user'])
|
||||
event_created = Signal()
|
||||
event_updated = Signal()
|
||||
event_status_updated = Signal()
|
||||
event_registration_closed = Signal()
|
||||
|
||||
|
||||
def signal_handler_for_event_update(sender, **kwargs):
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<form action="" method="post">
|
||||
<form id="id_event_update_form" action="" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if is_realized %}
|
||||
|
||||
@@ -4,7 +4,7 @@ from django import template
|
||||
from django.utils.html import format_html
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from ..models.eventchange import EventChange
|
||||
from ..models.eventstatus import EventStatus, get_or_create_event_status
|
||||
|
||||
@@ -5,7 +5,7 @@ import re
|
||||
from django.apps import apps
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import gettext
|
||||
|
||||
from dav_base.tests.generic import EmailTestMixin
|
||||
|
||||
@@ -80,7 +80,7 @@ class ActionTestCase(EmailTestMixin, RoleMixin, EventMixin, TestCase):
|
||||
|
||||
content = response.content.decode('utf-8')
|
||||
status_label = self.get_status_label(status_code)
|
||||
message = ugettext('Der Status wurde auf \'%(status)s\' gesetzt.') % {'status': status_label}
|
||||
message = gettext('Der Status wurde auf \'%(status)s\' gesetzt.') % {'status': status_label}
|
||||
html = message.replace('\'', ''')
|
||||
self.assertInHTML(html, content)
|
||||
self.assertRegex(content, r'alert-success')
|
||||
@@ -103,7 +103,7 @@ class ActionTestCase(EmailTestMixin, RoleMixin, EventMixin, TestCase):
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
content = response.content.decode('utf-8')
|
||||
html = ugettext('Diese Aktion hast du bereits ausgeführt.')
|
||||
html = gettext('Diese Aktion hast du bereits ausgeführt.')
|
||||
self.assertInHTML(html, content)
|
||||
self.assertRegex(content, r'alert-warning')
|
||||
|
||||
@@ -112,13 +112,13 @@ class ActionTestCase(EmailTestMixin, RoleMixin, EventMixin, TestCase):
|
||||
|
||||
content = response.content.decode('utf-8')
|
||||
status_label = self.get_status_label(status_code)
|
||||
message = (ugettext('Der Status wurde bereits'
|
||||
' am %(date)s'
|
||||
' von %(user)s'
|
||||
' auf \'%(status)s\' gesetzt.') % {
|
||||
message = (gettext('Der Status wurde bereits'
|
||||
' am %(date)s'
|
||||
' von %(user)s'
|
||||
' auf \'%(status)s\' gesetzt.') % {
|
||||
'status': status_label,
|
||||
# 'date': datetime.datetime.now().strftime('%d.%m.%Y %H:%M:%S'),
|
||||
'date': '\d{2}\.\d{2}\.\d{4} \d{2}:\d{2}:\d{2}',
|
||||
'date': r'\d{2}\.\d{2}\.\d{4} \d{2}:\d{2}:\d{2}',
|
||||
'user': user.get_full_name(),
|
||||
})
|
||||
html = message.replace('\'', ''')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import time
|
||||
from django.test import tag
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import gettext
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
@@ -528,7 +528,7 @@ class TestCase(SeleniumAuthMixin, RoleMixin, ScreenshotTestCase):
|
||||
self.wait_until_stale(c, link)
|
||||
|
||||
action_tabs = c.find_element(By.CSS_SELECTOR, '.action-tabs > ul.nav-tabs')
|
||||
tab = action_tabs.find_element(By.LINK_TEXT, ugettext(u'Ändern'))
|
||||
tab = action_tabs.find_element(By.LINK_TEXT, gettext(u'Ändern'))
|
||||
tab.click()
|
||||
self.wait_until_stale(c, tab)
|
||||
|
||||
@@ -537,14 +537,14 @@ class TestCase(SeleniumAuthMixin, RoleMixin, ScreenshotTestCase):
|
||||
if screenshots:
|
||||
self.save_screenshot('edit-form', sequence=sequence_name)
|
||||
|
||||
button = panel.find_element(By.PARTIAL_LINK_TEXT, ugettext(u'Nächster Abschnitt'))
|
||||
button = panel.find_element(By.PARTIAL_LINK_TEXT, gettext(u'Nächster Abschnitt'))
|
||||
button.click()
|
||||
time.sleep(.5)
|
||||
|
||||
if screenshots:
|
||||
self.save_screenshot('edit-form', sequence=sequence_name)
|
||||
|
||||
button = c.find_element(By.CSS_SELECTOR, 'form button[type="submit"]')
|
||||
button = c.find_element(By.CSS_SELECTOR, '#id_event_update_form button[type="submit"]')
|
||||
button.click()
|
||||
self.wait_until_stale(c, button)
|
||||
|
||||
@@ -580,7 +580,7 @@ class TestCase(SeleniumAuthMixin, RoleMixin, ScreenshotTestCase):
|
||||
if screenshots:
|
||||
self.save_screenshot('accepted', sequence=sequence_name)
|
||||
|
||||
link = c.find_element(By.LINK_TEXT, ugettext('Veranstaltungsliste'))
|
||||
link = c.find_element(By.LINK_TEXT, gettext('Veranstaltungsliste'))
|
||||
link.click()
|
||||
self.wait_until_stale(c, link)
|
||||
if screenshots:
|
||||
@@ -618,7 +618,7 @@ class TestCase(SeleniumAuthMixin, RoleMixin, ScreenshotTestCase):
|
||||
if screenshots:
|
||||
self.save_screenshot('confirmed_{}'.format(channel), sequence=sequence_name)
|
||||
|
||||
link = c.find_element(By.LINK_TEXT, ugettext('Veranstaltungsliste'))
|
||||
link = c.find_element(By.LINK_TEXT, gettext('Veranstaltungsliste'))
|
||||
link.click()
|
||||
self.wait_until_stale(c, link)
|
||||
if screenshots:
|
||||
@@ -650,7 +650,7 @@ class TestCase(SeleniumAuthMixin, RoleMixin, ScreenshotTestCase):
|
||||
if screenshots:
|
||||
self.save_screenshot('confirmed_clearance', sequence=sequence_name)
|
||||
|
||||
link = c.find_element(By.LINK_TEXT, ugettext('Veranstaltungsliste'))
|
||||
link = c.find_element(By.LINK_TEXT, gettext('Veranstaltungsliste'))
|
||||
link.click()
|
||||
self.wait_until_stale(c, link)
|
||||
if screenshots:
|
||||
@@ -730,7 +730,7 @@ class TestCase(SeleniumAuthMixin, RoleMixin, ScreenshotTestCase):
|
||||
button.click()
|
||||
self.wait_until_stale(c, button)
|
||||
|
||||
link = c.find_element(By.PARTIAL_LINK_TEXT, ugettext(u'Veranstaltungsliste herunterladen'))
|
||||
link = c.find_element(By.PARTIAL_LINK_TEXT, gettext(u'Veranstaltungsliste herunterladen'))
|
||||
link.click()
|
||||
self.wait_until_stale(c, link)
|
||||
self.save_screenshot('event_export_form')
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
from django.conf.urls import url
|
||||
from django.urls import re_path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'dav_events'
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^home$', views.base.HomeView.as_view(), name='root'),
|
||||
url(r'^$', views.events.EventListView.as_view(), name='list'),
|
||||
url(r'^export$', views.events.EventListExportView.as_view(), name='list_export'),
|
||||
url(r'^create$', views.events.EventCreateView.as_view(), name='create'),
|
||||
url(r'^(?P<pk>\d+)/registrations', views.events.EventRegistrationsView.as_view(), name='registrations'),
|
||||
url(r'^(?P<pk>\d+)/status/(?P<status>[a-z0-9._-][a-z0-9._-]*)',
|
||||
views.events.EventUpdateStatusView.as_view(), name='updatestatus'),
|
||||
url(r'^(?P<pk>\d+)/edit', views.events.EventUpdateView.as_view(), name='update'),
|
||||
url(r'^(?P<pk>\d+)/', views.events.EventDetailView.as_view(), name='detail'),
|
||||
url(r'^registration/(?P<pk>\d+)/', views.events.RespondRegistrationView.as_view(), name='respond_registration'),
|
||||
url(r'^action/(?P<pk>[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12})/',
|
||||
views.actions.OneClickActionRunView.as_view(), name='action_run'),
|
||||
re_path(r'^home$', views.base.HomeView.as_view(), name='root'),
|
||||
re_path(r'^$', views.events.EventListView.as_view(), name='list'),
|
||||
re_path(r'^export$', views.events.EventListExportView.as_view(), name='list_export'),
|
||||
re_path(r'^create$', views.events.EventCreateView.as_view(), name='create'),
|
||||
re_path(r'^(?P<pk>\d+)/registrations', views.events.EventRegistrationsView.as_view(), name='registrations'),
|
||||
re_path(r'^(?P<pk>\d+)/status/(?P<status>[a-z0-9._-][a-z0-9._-]*)',
|
||||
views.events.EventUpdateStatusView.as_view(), name='updatestatus'),
|
||||
re_path(r'^(?P<pk>\d+)/edit', views.events.EventUpdateView.as_view(), name='update'),
|
||||
re_path(r'^(?P<pk>\d+)/', views.events.EventDetailView.as_view(), name='detail'),
|
||||
re_path(r'^registration/(?P<pk>\d+)/', views.events.RespondRegistrationView.as_view(), name='respond_registration'),
|
||||
re_path(r'^action/(?P<pk>[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12})/',
|
||||
views.actions.OneClickActionRunView.as_view(), name='action_run'),
|
||||
]
|
||||
|
||||
@@ -2,7 +2,7 @@ import logging
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth import login
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
from django.views import generic
|
||||
|
||||
from .. import models
|
||||
|
||||
@@ -14,7 +14,7 @@ from django.shortcuts import get_object_or_404
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.text import normalize_newlines
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
from django.views import generic
|
||||
|
||||
from .. import choices
|
||||
|
||||
@@ -5,7 +5,7 @@ import re
|
||||
from django.apps import apps
|
||||
from django.db.models.functions import Length
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from . import emails
|
||||
from . import signals
|
||||
@@ -264,6 +264,9 @@ class BasicWorkflow(object):
|
||||
status_list = []
|
||||
self._check_status()
|
||||
|
||||
if not event.id:
|
||||
return status_list
|
||||
|
||||
heaviest_flag = event.flags.order_by('status').last()
|
||||
if heaviest_flag:
|
||||
flags = []
|
||||
|
||||
Reference in New Issue
Block a user