Ran black on sources
This commit is contained in:
parent
6fa68745ba
commit
43378b4c41
30 changed files with 473 additions and 275 deletions
|
|
@ -6,17 +6,17 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('help', '0003_auto_20190128_1820'),
|
||||
("help", "0003_auto_20190128_1820"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='helpentry',
|
||||
name='db_staff_only',
|
||||
model_name="helpentry",
|
||||
name="db_staff_only",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='helpentry',
|
||||
name='db_date_created',
|
||||
field=models.DateTimeField(auto_now=True, verbose_name='creation date'),
|
||||
model_name="helpentry",
|
||||
name="db_date_created",
|
||||
field=models.DateTimeField(auto_now=True, verbose_name="creation date"),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def update_help_entries(apps, schema_editor):
|
||||
"""
|
||||
Change all help-entry files that use view: locks to read: locks
|
||||
|
|
@ -11,8 +12,10 @@ def update_help_entries(apps, schema_editor):
|
|||
HelpEntry = apps.get_model("help", "HelpEntry")
|
||||
for help_entry in HelpEntry.objects.all():
|
||||
lock_storage = help_entry.db_lock_storage
|
||||
lock_storage = dict(lstring.split(":", 1) if ":" in lstring else (lstring, "")
|
||||
for lstring in str(lock_storage).split(";"))
|
||||
lock_storage = dict(
|
||||
lstring.split(":", 1) if ":" in lstring else (lstring, "")
|
||||
for lstring in str(lock_storage).split(";")
|
||||
)
|
||||
if "read" in lock_storage:
|
||||
# already in place - skip
|
||||
continue
|
||||
|
|
@ -26,9 +29,7 @@ def update_help_entries(apps, schema_editor):
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('help', '0004_auto_20210520_2137'),
|
||||
("help", "0004_auto_20210520_2137"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(update_help_entries)
|
||||
]
|
||||
operations = [migrations.RunPython(update_help_entries)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue