зеркало из https://github.com/mozilla/mentoring.git
fix migrations
This commit is contained in:
Родитель
18b49edc88
Коммит
8269c7d3ec
|
@ -0,0 +1,31 @@
|
|||
# Generated by Django 3.1.2 on 2021-01-22 16:21
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('participants', '0001_initial'),
|
||||
('pairing', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='pair',
|
||||
name='learner',
|
||||
field=models.ForeignKey(limit_choices_to={'role': 'L'}, on_delete=django.db.models.deletion.RESTRICT, related_name='learner_pairing', to='participants.participant'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pair',
|
||||
name='mentor',
|
||||
field=models.ForeignKey(limit_choices_to={'role': 'M'}, on_delete=django.db.models.deletion.RESTRICT, related_name='mentor_pairing', to='participants.participant'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pair',
|
||||
name='start_date',
|
||||
field=models.DateTimeField(default=django.utils.timezone.now, help_text='Date this pairing began'),
|
||||
),
|
||||
]
|
|
@ -5,6 +5,7 @@ from textwrap import dedent
|
|||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
from ..participants.models import Participant
|
||||
|
||||
|
@ -32,7 +33,7 @@ class Pair(models.Model):
|
|||
|
||||
start_date = models.DateTimeField(
|
||||
null=False,
|
||||
default=lambda: datetime.datetime.now(pytz.UTC),
|
||||
default=timezone.now,
|
||||
help_text=dedent('''Date this pairing began''')
|
||||
)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче