misc: apply double-quote-string-fixer (#79788)

This commit is contained in:
Valentin Deniaud 2023-08-16 11:52:29 +02:00
parent 02efc0cd33
commit 2489ed708e
31 changed files with 109 additions and 109 deletions

View File

@ -7,7 +7,7 @@ import json
import numpy
import random
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "docbow_project.settings")
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'docbow_project.settings')
from django.contrib.auth.models import User
from django.test.client import RequestFactory

View File

@ -3,9 +3,9 @@
import sys
import os
if __name__ == "__main__":
if __name__ == '__main__':
from django.core.management import execute_from_command_line
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "docbow_project.settings")
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'docbow_project.settings')
execute_from_command_line(sys.argv)

View File

@ -30,7 +30,7 @@ def export_as_csv(modeladmin, request, queryset):
return response
export_as_csv.short_description = _("Export selected objects as csv file")
export_as_csv.short_description = _('Export selected objects as csv file')
def activate_selected(modeladmin, request, queryset):

View File

@ -222,7 +222,7 @@ class AutomaticForwardingAdmin(admin.ModelAdmin):
def formfield_for_manytomany(self, db_field, request, **kwargs):
if db_field.name in ('originaly_to_user', 'forward_to_user'):
kwargs["queryset"] = models.non_guest_users()
kwargs['queryset'] = models.non_guest_users()
return super(AutomaticForwardingAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)

View File

@ -523,7 +523,7 @@ class PasswordResetFormWithLogging(PasswordResetForm):
"""
Validates that an active user exists with the given email address.
"""
identifier = self.cleaned_data["identifier"]
identifier = self.cleaned_data['identifier']
self.users_cache = User.objects.filter(
Q(email__iexact=identifier)
| Q(username=identifier)
@ -564,7 +564,7 @@ class PasswordResetFormWithLogging(PasswordResetForm):
Generates a one-use only link for resetting password and sends to the
user.
"""
email = self.cleaned_data["email"]
email = self.cleaned_data['email']
for user in self.get_users(email):
if not domain_override:
current_site = get_current_site(request)
@ -648,7 +648,7 @@ class EmailForm(ModelForm):
old_email = forms.EmailField(
label=_('Old email'), required=False, widget=forms.TextInput(attrs={'disabled': 'on'})
)
password = forms.CharField(label=_("Password"), widget=forms.PasswordInput())
password = forms.CharField(label=_('Password'), widget=forms.PasswordInput())
email = forms.EmailField(label=_('New email'), required=True, initial='')
email2 = forms.EmailField(label=_('New email (repeated)'), required=True, widget=forms.TextInput())

View File

@ -23,19 +23,19 @@ class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('ml_name', type=str, help='Name of the mailing list')
parser.add_argument(
"--add-list",
action="append",
'--add-list',
action='append',
help='add a list as a sublist',
default=[],
)
parser.add_argument(
"--remove-list",
action="append",
'--remove-list',
action='append',
help='remove list as a sublist',
default=[],
)
parser.add_argument("--add-user", action="append", help='add a user member', default=[])
parser.add_argument("--remove-user", action="append", help='remove a user member', default=[])
parser.add_argument('--add-user', action='append', help='add a user member', default=[])
parser.add_argument('--remove-user', action='append', help='remove a user member', default=[])
@transaction.atomic
def handle(self, **options):

View File

@ -24,22 +24,22 @@ List and groups can be referred by name or by id.
'''
option_list = BaseCommand.option_list + (
make_option("--first-name", help='set first name'),
make_option("--last-name", help='set last name'),
make_option("--email", help='set email'),
make_option("--mobile-phone", help='set mobile phone used for SMS notifications'),
make_option("--personal-email", help='set personal email'),
make_option("--add-list", help='add user to list', action="append", default=[]),
make_option("--add-group", help='add user to group', action="append", default=[]),
make_option("--remove-list", help='remove user from list', action="append", default=[]),
make_option("--remove-group", help='remove user from group', action="append", default=[]),
make_option('--first-name', help='set first name'),
make_option('--last-name', help='set last name'),
make_option('--email', help='set email'),
make_option('--mobile-phone', help='set mobile phone used for SMS notifications'),
make_option('--personal-email', help='set personal email'),
make_option('--add-list', help='add user to list', action='append', default=[]),
make_option('--add-group', help='add user to group', action='append', default=[]),
make_option('--remove-list', help='remove user from list', action='append', default=[]),
make_option('--remove-group', help='remove user from group', action='append', default=[]),
make_option(
"--activate", action="store_true", help='activate the user (default at creation)', default=None
'--activate', action='store_true', help='activate the user (default at creation)', default=None
),
make_option("--deactivate", dest='activate', action="store_false", help='deactivate the user'),
make_option("--superuser", action="store_true", help='set the superuser flag', default=None),
make_option('--deactivate', dest='activate', action='store_false', help='deactivate the user'),
make_option('--superuser', action='store_true', help='set the superuser flag', default=None),
make_option(
"--no-superuser", dest='superuser', action="store_false", help='unset the superuser flag'
'--no-superuser', dest='superuser', action='store_false', help='unset the superuser flag'
),
)

View File

@ -10,4 +10,4 @@ class Command(BaseCommand):
def handle(self, *args, **options):
count = models.Document.objects.count()
models.Document.objects.all().delete()
print("Definitively deleted %d documents." % count)
print('Definitively deleted %d documents.' % count)

View File

@ -56,9 +56,9 @@ class Command(BaseCommand):
),
)
help = (
"Output the contents of the database as a fixture of the given "
'Output the contents of the database as a fixture of the given '
"format (using each model's default manager unless --all is "
"specified)."
'specified).'
)
args = '[appname appname.ModelName ...]'
@ -103,12 +103,12 @@ class Command(BaseCommand):
try:
app = get_app(app_label)
except ImproperlyConfigured:
raise CommandError("Unknown application: %s" % app_label)
raise CommandError('Unknown application: %s' % app_label)
if app in excluded_apps:
continue
model = get_model(app_label, model_label)
if model is None:
raise CommandError("Unknown model: %s.%s" % (app_label, model_label))
raise CommandError('Unknown model: %s.%s' % (app_label, model_label))
if model in excluded_models:
continue
if app in app_list.keys():
@ -122,7 +122,7 @@ class Command(BaseCommand):
try:
app = get_app(app_label)
except ImproperlyConfigured:
raise CommandError("Unknown application: %s" % app_label)
raise CommandError('Unknown application: %s' % app_label)
if app in excluded_apps:
continue
app_list[app] = None
@ -130,12 +130,12 @@ class Command(BaseCommand):
# Check that the serialization format exists; this is a shortcut to
# avoid collating all the objects and _then_ failing.
if format not in serializers.get_public_serializer_formats():
raise CommandError("Unknown serialization format: %s" % format)
raise CommandError('Unknown serialization format: %s' % format)
try:
serializers.get_serializer(format)
except KeyError:
raise CommandError("Unknown serialization format: %s" % format)
raise CommandError('Unknown serialization format: %s' % format)
# Now collate the objects to be serialized.
objects = []
@ -155,7 +155,7 @@ class Command(BaseCommand):
except Exception as e:
if show_traceback:
raise
raise CommandError("Unable to serialize database: %s" % e)
raise CommandError('Unable to serialize database: %s' % e)
def sort_dependencies(app_list):

View File

@ -13,7 +13,7 @@ from ...unicodecsv import UnicodeWriter
def print_table(table):
col_width = [max(len(x) for x in col) for col in zip(*table)]
for line in table:
line = u"| " + u" | ".join(u"{0:>{1}}".format(x, col_width[i]) for i, x in enumerate(line)) + u" |"
line = u'| ' + u' | '.join(u'{0:>{1}}'.format(x, col_width[i]) for i, x in enumerate(line)) + u' |'
print(line)
@ -21,7 +21,7 @@ class Command(BaseCommand):
args = ''
help = '''List mailing lists'''
option_list = BaseCommand.option_list + (make_option("--csv", action='store_true'),)
option_list = BaseCommand.option_list + (make_option('--csv', action='store_true'),)
@transaction.atomic
def handle(self, *args, **options):

View File

@ -14,7 +14,7 @@ from ...unicodecsv import UnicodeWriter
def print_table(table):
col_width = [max(len(x) for x in col) for col in zip(*table)]
for line in table:
line = u"| " + u" | ".join(u"{0:>{1}}".format(x, col_width[i]) for i, x in enumerate(line)) + u" |"
line = u'| ' + u' | '.join(u'{0:>{1}}'.format(x, col_width[i]) for i, x in enumerate(line)) + u' |'
print(line)
@ -22,7 +22,7 @@ class Command(BaseCommand):
args = ''
help = '''List users'''
option_list = BaseCommand.option_list + (make_option("--csv", action='store_true'),)
option_list = BaseCommand.option_list + (make_option('--csv', action='store_true'),)
@transaction.atomic
def handle(self, *args, **options):

View File

@ -46,11 +46,11 @@ class Command(BaseCommand):
help = 'Load a CSV file containg user definitions'
option_list = BaseCommand.option_list + (
make_option("--profile", action='append', default=[]),
make_option("--group", action='append', default=[]),
make_option("--password", action='store'),
make_option("--activate", action='store_true'),
make_option("--generate-password", action='store_true', dest='generate_password'),
make_option('--profile', action='append', default=[]),
make_option('--group', action='append', default=[]),
make_option('--password', action='store'),
make_option('--activate', action='store_true'),
make_option('--generate-password', action='store_true', dest='generate_password'),
)
headers = {
@ -69,7 +69,7 @@ class Command(BaseCommand):
raise CommandError('Username or nom/prenom must be given')
prenom = keep_letters(strip_accents(data['prenom'])).lower()
nom = keep_letters(strip_accents(data['nom'])).lower()
username = "%s.%s" % (prenom, nom)
username = '%s.%s' % (prenom, nom)
data['username'] = username
if 'profil' not in data:
@ -92,15 +92,15 @@ class Command(BaseCommand):
def handle(self, *args, **options):
if len(args) == 0:
raise CommandError("missing filename")
raise CommandError('missing filename')
if not os.path.exists(args[0]):
raise CommandError("%s not found" % args[0])
raise CommandError('%s not found' % args[0])
tuples = unicode_csv_reader(open(args[0]), dialect='excel')
first = tuples.next()
allowed_headers = set(self.headers.keys())
if not set(first) <= allowed_headers:
msg = "Bad headers %s, only those are permitted: %s" % (first, allowed_headers)
msg = 'Bad headers %s, only those are permitted: %s' % (first, allowed_headers)
raise CommandError(msg)
all_users = []

View File

@ -24,11 +24,11 @@ class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('file_tosend', nargs='+', type=str, help='File to send')
parser.add_argument("--sender")
parser.add_argument("--to-list", action="append")
parser.add_argument("--to-user", action="append")
parser.add_argument("--filetype")
parser.add_argument("--description")
parser.add_argument('--sender')
parser.add_argument('--to-list', action='append')
parser.add_argument('--to-user', action='append')
parser.add_argument('--filetype')
parser.add_argument('--description')
@transaction.atomic
def handle(self, **options):

View File

@ -226,7 +226,7 @@ class Document(Model):
ordering = ['-date']
verbose_name = _('Document')
verbose_name_plural = _('Documents')
permissions = ((FORWARD_PERMISSION, _("Can forward documents")),)
permissions = ((FORWARD_PERMISSION, _('Can forward documents')),)
base_manager_name = 'objects'
sender = ForeignKey(User, verbose_name=_('Sender'), on_delete=CASCADE, related_name='documents_sent')
@ -431,7 +431,7 @@ class Document(Model):
return username(self.sender)
def extra_senders_display(self):
return " ".join([username(sender) for sender in self.extra_senders.all()])
return ' '.join([username(sender) for sender in self.extra_senders.all()])
def url(self):
return urllib.parse.urljoin(
@ -638,13 +638,13 @@ class Delegation(Model):
User,
related_name='delegations_to',
on_delete=CASCADE,
verbose_name=pgettext_lazy('delegation from', "From"),
verbose_name=pgettext_lazy('delegation from', 'From'),
)
to = ForeignKey(
User,
related_name='delegations_by',
on_delete=CASCADE,
verbose_name=pgettext_lazy('delegation to', "To"),
verbose_name=pgettext_lazy('delegation to', 'To'),
)
class Meta:
@ -830,7 +830,7 @@ class DocbowProfile(Model):
verbose_name=_('Accept to be notified'),
blank=True,
default=True,
help_text=_("If unchecked you will not received notifications " "anymore, by email or SMS."),
help_text=_('If unchecked you will not received notifications ' 'anymore, by email or SMS.'),
)
external_id = CharField(max_length=256, verbose_name=_('External identifer'), blank=True)

View File

@ -78,31 +78,31 @@ class Collator:
def load(self, filename):
for line in open(filename):
if line.startswith("#") or line.startswith("%"):
if line.startswith('#') or line.startswith('%'):
continue
if line.strip() == "":
if line.strip() == '':
continue
line = line[: line.find("#")] + "\n"
line = line[: line.find("%")] + "\n"
line = line[: line.find('#')] + '\n'
line = line[: line.find('%')] + '\n'
line = line.strip()
if line.startswith("@"):
if line.startswith('@'):
pass
else:
semicolon = line.find(";")
semicolon = line.find(';')
charList = line[:semicolon].strip().split()
x = line[semicolon:]
collElements = []
while True:
begin = x.find("[")
begin = x.find('[')
if begin == -1:
break
end = x[begin:].find("]")
end = x[begin:].find(']')
collElement = x[begin : begin + end + 1]
x = x[begin + 1 :]
alt = collElement[1]
chars = collElement[2:-1].split(".")
chars = collElement[2:-1].split('.')
collElements.append((alt, chars))
integer_points = [int(ch, 16) for ch in charList]

View File

@ -12,7 +12,7 @@ from docbow_project.docbow import models
class MailboxTable(tables.Table):
class Meta:
model = models.Document
attrs = {"class": "paleblue"}
attrs = {'class': 'paleblue'}
# FIXEM: translation in inline templates are ignored
@ -34,7 +34,7 @@ class OutboxCsvTable(tables.Table):
model = models.Document
fields = ('official_sender',)
sequence = ('recipients', 'official_sender', 'real_sender', 'filetype', 'filenames', '...')
attrs = {"class": "paleblue mailbox-table"}
attrs = {'class': 'paleblue mailbox-table'}
empty_text = _('No message')
@ -67,7 +67,7 @@ class OutboxBaseTable(tables.Table):
model = models.Document
fields = ('official_sender',)
sequence = ('recipients', 'official_sender', 'real_sender', 'filetype', 'filenames', '...')
attrs = {"class": "paleblue mailbox-table refresh", "id": "outbox-table"}
attrs = {'class': 'paleblue mailbox-table refresh', 'id': 'outbox-table'}
empty_text = _('No message')
@ -89,7 +89,7 @@ class OutboxTrashTable(OutboxBaseTable):
'filenames',
'...',
)
attrs = {"class": "paleblue mailbox-table refresh", "id": "outbox-table"}
attrs = {'class': 'paleblue mailbox-table refresh', 'id': 'outbox-table'}
empty_text = _('No message')
@ -116,7 +116,7 @@ class OutboxTable(OutboxBaseTable):
'filenames',
'...',
)
attrs = {"class": "paleblue mailbox-table refresh", "id": "outbox-table"}
attrs = {'class': 'paleblue mailbox-table refresh', 'id': 'outbox-table'}
empty_text = _('No message')
@ -128,7 +128,7 @@ class InboxCsvTable(tables.Table):
class Meta:
model = models.Document
attrs = {"class": "paleblue mailbox-table"}
attrs = {'class': 'paleblue mailbox-table'}
empty_text = _('No message')
@ -162,7 +162,7 @@ class InboxBaseTable(tables.Table):
'seen',
'filetype',
)
attrs = {"class": "paleblue mailbox-table refresh", "id": "outbox-table"}
attrs = {'class': 'paleblue mailbox-table refresh', 'id': 'outbox-table'}
empty_text = _('No message')
@ -179,7 +179,7 @@ class InboxTrashTable(InboxBaseTable):
'seen',
'filetype',
)
attrs = {"class": "paleblue mailbox-table refresh", "id": "inbox-table"}
attrs = {'class': 'paleblue mailbox-table refresh', 'id': 'inbox-table'}
empty_text = _('No message')
@ -200,5 +200,5 @@ class InboxTable(InboxBaseTable):
'seen',
'filetype',
)
attrs = {"class": "paleblue mailbox-table refresh", "id": "outbox-table"}
attrs = {'class': 'paleblue mailbox-table refresh', 'id': 'outbox-table'}
empty_text = _('No message')

View File

@ -99,7 +99,7 @@ def frfilesizeformat(value):
else:
value = value / (1024 * 1024.0)
unit = _('MB')
return "%.1f %s" % (value, unit)
return '%.1f %s' % (value, unit)
register.filter(frfilesizeformat)
@ -152,4 +152,4 @@ def intersect(iterable1, iterable2):
@register.filter
def is_checkbox(field):
return field.field.widget.__class__.__name__.lower() == "checkboxinput"
return field.field.widget.__class__.__name__.lower() == 'checkboxinput'

View File

@ -23,7 +23,7 @@ class UnicodeWriter(object):
fp.close()
"""
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
def __init__(self, f, dialect=csv.excel, encoding='utf-8', **kwds):
# Redirect output to a queue
self.queue = StringIO()
self.writer = csv.writer(self.queue, dialect=dialect, **kwds)
@ -32,10 +32,10 @@ class UnicodeWriter(object):
def writerow(self, row):
# Modified from original: now using unicode(s) to deal with e.g. ints
self.writer.writerow([force_str(s).encode("utf-8") for s in row])
self.writer.writerow([force_str(s).encode('utf-8') for s in row])
# Fetch UTF-8 output from the queue ...
data = self.queue.getvalue()
data = force_text(data, "utf-8")
data = force_text(data, 'utf-8')
# ... and reencode it into the target encoding
data = data.encode(self.encoding)
# write to the target stream
@ -70,7 +70,7 @@ class UnicodeDictWriter(UnicodeWriter):
Initially derived from http://docs.python.org/lib/csv-examples.html
"""
def __init__(self, f, fields, dialect=csv.excel_tab, encoding="utf-16", **kwds):
def __init__(self, f, fields, dialect=csv.excel_tab, encoding='utf-16', **kwds):
super(UnicodeDictWriter, self).__init__(f, dialect, encoding, **kwds)
self.fields = fields

View File

@ -41,16 +41,16 @@ def get_data_for_id(upload_id):
def response_mimetype(request):
if "application/json" in request.META['HTTP_ACCEPT']:
return "application/json"
if 'application/json' in request.META['HTTP_ACCEPT']:
return 'application/json'
else:
return "text/plain"
return 'text/plain'
class JSONResponse(HttpResponse):
"""JSON response class."""
def __init__(self, obj='', json_opts={}, mimetype="application/json", *args, **kwargs):
def __init__(self, obj='', json_opts={}, mimetype='application/json', *args, **kwargs):
content = json.dumps(obj, **json_opts)
super(JSONResponse, self).__init__(content, mimetype, *args, **kwargs)
@ -105,7 +105,7 @@ def upload(request, transaction_id, file_kind=None):
'size': uploaded_file.size,
'url': url,
'delete_url': url,
'delete_type': "DELETE",
'delete_type': 'DELETE',
}
)
response = JSONResponse(data, {}, response_mimetype(request))

View File

@ -414,7 +414,7 @@ def message(request, mailbox_id, outbox=False):
ctx['related_users'] = get_related_users(request)
extra_senders = ''
if document.extra_senders.exists():
extra_senders = ", ".join([username(sender) for sender in document.extra_senders.all()])
extra_senders = ', '.join([username(sender) for sender in document.extra_senders.all()])
ctx['extra_senders'] = extra_senders
return render(request, 'docbow/message.html', ctx)
@ -554,7 +554,7 @@ def inbox_by_document(request, document_id):
return redirect('inbox-message', mailbox_id=document_id)
@require_http_methods(["POST"])
@require_http_methods(['POST'])
def restore(request, doc_id, outbox=False):
try:
deleted_doc = DeletedDocument.objects.get(user=request.user, document__pk=doc_id, soft_delete=True)

View File

@ -176,7 +176,7 @@ class JqueryFileUploadInput(MultiWidget):
class ForcedValueWidget(SelectMultiple):
def __init__(self, attrs=None, format=None, value=None, display_value=""):
def __init__(self, attrs=None, format=None, value=None, display_value=''):
super(ForcedValueWidget, self).__init__(attrs)
self.display_value = display_value
self.value = value
@ -201,10 +201,10 @@ class FilteredSelectMultiple(SelectMultiple):
class Media:
js = (
"docbow/filter-widget/js/core.js",
"docbow/filter-widget/js/SelectBox.js",
"docbow/filter-widget/js/SelectFilter2.js",
"js/i18n.js",
'docbow/filter-widget/js/core.js',
'docbow/filter-widget/js/SelectBox.js',
'docbow/filter-widget/js/SelectFilter2.js',
'js/i18n.js',
)
css = {'all': ('docbow/filter-widget/css/filter-widget.css',)}

View File

@ -93,7 +93,7 @@ class Command(BaseCommand):
with open(journal_path, 'w') as journal_file:
for b in batch(journals, window):
for journal in b:
journal_file.write("%s %s" % (journal.time, force_str(journal).replace('\n', '\n ')))
journal_file.write('%s %s' % (journal.time, force_str(journal).replace('\n', '\n ')))
i += b.count()
print(
' - Archived %10d lines\r' % i,

View File

@ -55,8 +55,8 @@ In case of failure the following return value is returned:
def add_arguments(self, parser):
parser.add_argument('recipient', type=str)
parser.add_argument("--sender")
parser.add_argument("--file")
parser.add_argument('--sender')
parser.add_argument('--file')
def handle(self, *args, **options):
if not options.get('sender'):

View File

@ -12,7 +12,7 @@ class PloneFileType(models.Model):
class Meta:
# backward compatibility
db_table = "plone_plonefiletype"
db_table = 'plone_plonefiletype'
verbose_name = _('Plone file type')
verbose_name_plural = _('Plone file types')

View File

@ -55,8 +55,8 @@ In case of failure the following return value is returned:
def add_arguments(self, parser):
parser.add_argument('recipient', type=str)
parser.add_argument("--sender")
parser.add_argument("--file")
parser.add_argument('--sender')
parser.add_argument('--file')
def handle(self, *args, **options):
if not options.get('sender'):

View File

@ -15,7 +15,7 @@ framework.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "docbow_project.settings")
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'docbow_project.settings')
from django.core.wsgi import get_wsgi_application

View File

@ -2,8 +2,8 @@
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "docbow_project.settings")
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'docbow_project.settings')
from django.core.management import execute_from_command_line

View File

@ -429,7 +429,7 @@ def test_send_file(users_fixture, filetype_fixtures, settings, tmpdir, monkeypat
settings.MEDIA_ROOT = tmpdir.strpath
monkeypatch.chdir(tmpdir)
filetosend = tmpdir.join('filetosend.txt')
filetosend.write("file content")
filetosend.write('file content')
management.call_command(
'sendfile',
'--sender',

View File

@ -10,7 +10,7 @@ DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'TEST': {
'NAME': 'docbow-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],
'NAME': 'docbow-test-%s' % os.environ.get('BRANCH_NAME', '').replace('/', '-')[:63],
},
}
}

View File

@ -8,7 +8,7 @@ DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'TEST': {
'NAME': 'docbow-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],
'NAME': 'docbow-test-%s' % os.environ.get('BRANCH_NAME', '').replace('/', '-')[:63],
},
}
}
@ -18,7 +18,7 @@ PARLEMENT = os.environ['PARLEMENT']
if PARLEMENT == 'pfwb':
INSTALLED_APPS += ('docbow_project.pfwb',)
DOCBOW_EDIT_EMAIL = True
TABELLIO_DBNAME = 'tabellio-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63]
TABELLIO_DBNAME = 'tabellio-test-%s' % os.environ.get('BRANCH_NAME', '').replace('/', '-')[:63]
TABELLIO_DBHOST = ''
TABELLIO_DBPORT = ''
TABELLIO_DBUSER = ''

View File

@ -8,7 +8,7 @@ DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'TEST': {
'NAME': 'docbow-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],
'NAME': 'docbow-test-%s' % os.environ.get('BRANCH_NAME', '').replace('/', '-')[:63],
},
}
}