forked from DGNum/gestioCOF
Black v20
This commit is contained in:
parent
1d707aad41
commit
0875ef1278
13 changed files with 49 additions and 31 deletions
|
@ -12,8 +12,9 @@ def forwards_func(apps, schema_editor):
|
||||||
|
|
||||||
for revente in SpectacleRevente.objects.all():
|
for revente in SpectacleRevente.objects.all():
|
||||||
is_expired = timezone.now() > revente.date_tirage()
|
is_expired = timezone.now() > revente.date_tirage()
|
||||||
is_direct = revente.attribution.spectacle.date >= revente.date and timezone.now() > revente.date + timedelta(
|
is_direct = (
|
||||||
minutes=15
|
revente.attribution.spectacle.date >= revente.date
|
||||||
|
and timezone.now() > revente.date + timedelta(minutes=15)
|
||||||
)
|
)
|
||||||
revente.shotgun = is_expired or is_direct
|
revente.shotgun = is_expired or is_direct
|
||||||
revente.save()
|
revente.save()
|
||||||
|
|
|
@ -18,5 +18,8 @@ class Migration(migrations.Migration):
|
||||||
"verbose_name_plural": "Profils BDS",
|
"verbose_name_plural": "Profils BDS",
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.RemoveField(model_name="bdsprofile", name="is_buro",),
|
migrations.RemoveField(
|
||||||
|
model_name="bdsprofile",
|
||||||
|
name="is_buro",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -10,5 +10,8 @@ class Migration(migrations.Migration):
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RemoveField(model_name="bdsprofile", name="certificate_file",),
|
migrations.RemoveField(
|
||||||
|
model_name="bdsprofile",
|
||||||
|
name="certificate_file",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -13,18 +13,23 @@ class Migration(migrations.Migration):
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AlterUniqueTogether(
|
migrations.AlterUniqueTogether(
|
||||||
name="extrafield", unique_together={("event", "name")},
|
name="extrafield",
|
||||||
|
unique_together={("event", "name")},
|
||||||
),
|
),
|
||||||
migrations.AlterUniqueTogether(
|
migrations.AlterUniqueTogether(
|
||||||
name="extrafieldcontent", unique_together={("field", "registration")},
|
name="extrafieldcontent",
|
||||||
|
unique_together={("field", "registration")},
|
||||||
),
|
),
|
||||||
migrations.AlterUniqueTogether(
|
migrations.AlterUniqueTogether(
|
||||||
name="option", unique_together={("event", "name")},
|
name="option",
|
||||||
|
unique_together={("event", "name")},
|
||||||
),
|
),
|
||||||
migrations.AlterUniqueTogether(
|
migrations.AlterUniqueTogether(
|
||||||
name="optionchoice", unique_together={("option", "choice")},
|
name="optionchoice",
|
||||||
|
unique_together={("option", "choice")},
|
||||||
),
|
),
|
||||||
migrations.AlterUniqueTogether(
|
migrations.AlterUniqueTogether(
|
||||||
name="registration", unique_together={("event", "user")},
|
name="registration",
|
||||||
|
unique_together={("event", "user")},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -25,7 +25,8 @@ def make_user(name):
|
||||||
|
|
||||||
def make_staff_user(name):
|
def make_staff_user(name):
|
||||||
view_event_perm = Permission.objects.get(
|
view_event_perm = Permission.objects.get(
|
||||||
codename="view_event", content_type__app_label="events",
|
codename="view_event",
|
||||||
|
content_type__app_label="events",
|
||||||
)
|
)
|
||||||
user = make_user(name)
|
user = make_user(name)
|
||||||
user.user_permissions.add(view_event_perm)
|
user.user_permissions.add(view_event_perm)
|
||||||
|
|
|
@ -589,7 +589,8 @@ class ExportMegaParticipantsViewTests(MegaHelperMixin, ViewTestCaseMixin, TestCa
|
||||||
|
|
||||||
self.assertEqual(r.status_code, 200)
|
self.assertEqual(r.status_code, 200)
|
||||||
self.assertCSVEqual(
|
self.assertCSVEqual(
|
||||||
r, [["u2", "", "", "", "", str(self.u2.pk), "", ""]],
|
r,
|
||||||
|
[["u2", "", "", "", "", str(self.u2.pk), "", ""]],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,9 @@ class Command(MyBaseCommand):
|
||||||
group_chef.save()
|
group_chef.save()
|
||||||
group_boy.save()
|
group_boy.save()
|
||||||
|
|
||||||
permissions_chef = Permission.objects.filter(content_type__app_label="kfet",)
|
permissions_chef = Permission.objects.filter(
|
||||||
|
content_type__app_label="kfet",
|
||||||
|
)
|
||||||
permissions_boy = Permission.objects.filter(
|
permissions_boy = Permission.objects.filter(
|
||||||
content_type__app_label="kfet", codename__in=["is_team", "perform_deposit"]
|
content_type__app_label="kfet", codename__in=["is_team", "perform_deposit"]
|
||||||
)
|
)
|
||||||
|
|
|
@ -1778,7 +1778,8 @@ class KPsulPerformOperationsViewTests(ViewTestCaseMixin, TestCase):
|
||||||
# Another Article, price=2.5, stock=20, no COF reduction
|
# Another Article, price=2.5, stock=20, no COF reduction
|
||||||
self.article_no_reduction = Article.objects.create(
|
self.article_no_reduction = Article.objects.create(
|
||||||
category=ArticleCategory.objects.create(
|
category=ArticleCategory.objects.create(
|
||||||
name="Category_no_reduction", has_reduction=False,
|
name="Category_no_reduction",
|
||||||
|
has_reduction=False,
|
||||||
),
|
),
|
||||||
name="Article_no_reduction",
|
name="Article_no_reduction",
|
||||||
price=Decimal("2.5"),
|
price=Decimal("2.5"),
|
||||||
|
@ -3799,7 +3800,8 @@ class KPsulCancelOperationsViewTests(ViewTestCaseMixin, TestCase):
|
||||||
self.assertEqual(self.checkout.balance, Decimal("100.00"))
|
self.assertEqual(self.checkout.balance, Decimal("100.00"))
|
||||||
|
|
||||||
self.kpsul_consumer_mock.group_send.assert_called_with(
|
self.kpsul_consumer_mock.group_send.assert_called_with(
|
||||||
"kfet.kpsul", {"checkouts": [], "articles": []},
|
"kfet.kpsul",
|
||||||
|
{"checkouts": [], "articles": []},
|
||||||
)
|
)
|
||||||
|
|
||||||
@mock.patch("django.utils.timezone.now")
|
@mock.patch("django.utils.timezone.now")
|
||||||
|
|
Loading…
Reference in a new issue