Re: [Django] #34151: Adding explicit primary key with different type doesn't update related ManyToManyFields.

2023-04-28 Thread Django
#34151: Adding explicit primary key with different type doesn't update related
ManyToManyFields.
-+-
 Reporter:  STANISLAV LEPEKHOV   |Owner:  Priyank
 |  Panchal
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  migrations pk uuid   | Triage Stage:  Accepted
  relation   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Priyank Panchal):

 * owner:  Ayush Bisht => Priyank Panchal


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187cb847f81-a6ac2aa1-5f43-4dff-911e-891514a4fdbf-00%40eu-central-1.amazonses.com.


Re: [Django] #34523: Model.objects.update_or_create method sometimes raises TransactionManagementError

2023-04-28 Thread Django
#34523: Model.objects.update_or_create method sometimes raises
TransactionManagementError
-+-
 Reporter:  gatello-s|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  update_or_create | Triage Stage:
  TransactionManagementError |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 The changes in 331a460f8f2e4f447b68fba491464b68c9b21fd1 are semantically
 correct but they had the side effect of making
 `BaseDatabaseWrapper._savepoint_allowed` return `False` and thus
 `savepoint()` creation always return `None`.

 Since `update_or_create` uses nested `atomic` to handle possible integrity
 errors it was previously taking the savepoints created by MySQL as way to
 mark back the connection as usable. Now that savepoints are not returned
 anymore it assumes the outer atomic block is tainted as well and raise
 `TransactionManagementError`.

 I'm not sure why `Atomic.__enter__` and `__exit__` are not simply noops
 when transactions are determined to not be supported instead of trying to
 handle all kind of nesting and savepoint combinations.

 {{{#!diff
 diff --git a/django/db/transaction.py b/django/db/transaction.py
 index 4150cbcbbe..28229f8f3a 100644
 --- a/django/db/transaction.py
 +++ b/django/db/transaction.py
 @@ -181,6 +181,8 @@ def __init__(self, using, savepoint, durable):

  def __enter__(self):
  connection = get_connection(self.using)
 +if not connection.features.supports_transactions:
 +return

  if (
  self.durable
 @@ -223,6 +225,8 @@ def __enter__(self):

  def __exit__(self, exc_type, exc_value, traceback):
  connection = get_connection(self.using)
 +if not connection.features.supports_transactions:
 +return

  if connection.in_atomic_block:
  connection.atomic_blocks.pop()
 }}}

 As for the heuristics to determine if a backend supports transaction the
 situation is definitely weird on MySQL as supports is on a per-table basis
 and `default_storage_engine` is really just a guess at that.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187cb6d4824-f2855de3-694f-49f1-a603-4302f736fc96-00%40eu-central-1.amazonses.com.


Re: [Django] #34523: Model.objects.update_or_create method sometimes raises TransactionManagementError

2023-04-28 Thread Django
#34523: Model.objects.update_or_create method sometimes raises
TransactionManagementError
-+-
 Reporter:  gatello-s|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  update_or_create | Triage Stage:
  TransactionManagementError |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Bisected to the 331a460f8f2e4f447b68fba491464b68c9b21fd1, however the
 `MyISAM` storage engine doesn't support transactions so I'm not sure how
 it worked before.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c9960334-797c9275-f94e-49b1-b85f-da8add5f3e1c-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * cc: Simon Charette (added)


Comment:

 To be clear, I believe that we wanted to do the same for
 `AlterIndexTogether()` and `CreateModel()`'s `index_together` i.e. support
 them only for pre-Django 4.2 migration files and don't deprecate or remove
 them. That's why we should avoid raising deprecation warnings for model
 states and add a similar [https://docs.djangoproject.com/en/4.2/ref
 /migration-operations/#alterindextogether warning] to the `CreateModel()`
 docs.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c9783a2a-f90a3132-b6d3-44d7-b4c0-8ae9a4d77ef4-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 I would like to add Simon as CC so we can hear their opinion, but it seems
 I can't add people as CC (other than myself). I will ask Mariusz for the
 extra perms next week.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c96d1d8c-b32f6281-b45d-42e2-8462-ad0d3d94f09a-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 Avoiding spurious deprecation warnings in historical migrations is one
 reason that model fields are deprecated using the system check framework.
 I wonder if this approach was considered for this deprecation (although
 the proposed patch might work too).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c946ee8a-16891560-6f29-4d33-9ff6-74d8f088d6ae-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 I'm getting familiar with ticket:27236#comment:31, which seems extremely
 relevant for making further decisions on this one.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c90620dc-18502a54-fe7a-4acd-94b7-25926d0d47d9-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Replying to [comment:10 Natalia Bidart]:
 > Well of course the warning is not present in `4.1` since the deprecation
 was added in `4.2` :-D. I still don't think this is a release blocker
 though.

 If you consider it a bug then it is a release blocker, it doesn't matter
 if it's "big" or "small".

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c8eb696e-4eea2d9c-242c-4f8a-a85e-1d831523cdae-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Well of course the warning is not present in `4.1` since the deprecation
 was added in `4.2` :-D. I still don't think this is a release blocker
 though.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c8c4019e-22412a6c-8e24-414c-85e4-ea06e32b6bda-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Mariusz: the warning is shown every time the tests are run, and the
 `index_together` is declared in the `0001_initial.py` migration. This may
 be caused by the test database setup, when migrations are run, so perhaps
 the answer to you question is "no" because the initial migration is being
 applied in the test database. When running the dev server or other
 operations (`makemigrations`, `migrate`, etc.), the warning is not
 printed. This is why I did not consider it a release blocker, but a "nice
 to have" (IMHO).

 This happens for `4.2` and `main`, will check against  `4.1` and report
 back.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c8c2adee-a0c21b8a-36f3-4d02-8252-3107e150d95d-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Our plan (as usually when we deprecate/remove features from the ORM) was
 to support `Meta.index_together` only in historical migrations (already
 applied), see
 
[https://github.com/django/django/blob/5a6d4d3bfde07daab9777545694beb014c832264/django/db/models/options.py#L46-L47
 DEFAULT_NAMES].

 Is the warning triggered for already applied migrations?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c8b53a0a-1f5f4f80-16d1-44a1-b8eb-bb9aceb72180-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * severity:  Normal => Release blocker


Comment:

 Replying to [comment:5 Natalia Bidart]:

 > I'm not familiar with migrations but I think this is a valid report,
 accepting (at least until with more experience in this topic decides
 otherwise).

 If it is a regression in Django 4.2 it should be marked as a release
 blocker (I didn't check it.)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c879fa7d-486a2844-ea9a-48cf-9e0b-24a5a8b7d0c2-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * cc: Natalia Bidart (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c870ba64-c1e9699a-bcfe-4400-8bba-7df9f8a2f488-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  index_together,  | Triage Stage:  Accepted
  warning|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * stage:  Unreviewed => Accepted


Comment:

 I'm able to reproduce the warning using latest `main` and the Django test
 framework. But removing the migrations from the test repo and starting
 fresh does not raise the warning (as expected).

 Thank you Tim for the pointer to the release notes, while it's true
 nothing is said about supporting `index_together` in older migrations,
 IMHO it would be ideal if the `RemovedInDjango51Warning` is not emitted
 for code bases that were already migrated out of the deprecated feature.

 I'm not familiar with migrations but I think this is a valid report,
 accepting (at least until with more experience in this topic decides
 otherwise).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c8652418-9a7f2e6c-47fb-4596-947c-dc388dcdfca5-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  index_together,  | Triage Stage:
  warning|  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 Based on [https://docs.djangoproject.com/en/dev/releases/4.2/#index-
 together-option-is-deprecated-in-favor-of-indexes the deprecation note in
 the 4.2 release notes], it's unclear whether or not the plan is to support
 `index_together` in historical migrations.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c84172d0-e2aac852-858b-41be-99bb-9b8fecb259dc-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  index_together,  | Triage Stage:
  warning|  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Actually let me try to reproduce first to confirm whether this ticket
 should be Accepted or not, so you don't need to prepare the PR is there is
 something else going on.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c8113343-7d752166-4981-419a-a74b-e42b742e8f13-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  index_together,  | Triage Stage:
  warning|  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Hello! Thank you for your contribution.

 Would you have the time to propose the patch as GitHub PR? Here is the
 documentation explaining how to submit contributions:
 https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
 /submitting-patches/

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c80f9cec-f9c42b11-fef6-4d3b-8831-fdd6f806429b-00%40eu-central-1.amazonses.com.


Re: [Django] #34523: Model.objects.update_or_create method sometimes raises TransactionManagementError (was: update_or_create not work in parallel insertion)

2023-04-28 Thread Django
#34523: Model.objects.update_or_create method sometimes raises
TransactionManagementError
-+-
 Reporter:  gatello-s|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  update_or_create | Triage Stage:
  TransactionManagementError |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Anton Plotkin):

 * cc: Anton Plotkin (added)
 * status:  closed => new
 * resolution:  needsinfo =>


Old description:

> I am tests on mariadb 10.5.19 (myisam).
> This test work fine on django-3.2.16
>
> {{{
> class TransactionManagementErrorTest(TestCase):
>
> class TestModel(models.Model):
> field = models.IntegerField(null=True)
>
> class Meta(object):
> db_table = 'test_model_update_or_create'
>
> class QuerySet(models.QuerySet):
> def create(self, **kwargs):
> super().create(**kwargs)  # simulate parallel insertion
> return super().create(**kwargs)
>
> class TestModelManager(models.Manager.from_queryset(QuerySet)):
> pass
>
> objects = TestModelManager()
>
> def exec_sql(self, sql):
> from django.db import connections, router
> db = router.db_for_write(self.TestModel)
> connection = connections[db]
> connection.cursor().execute(sql)
>
> def setUp(self):
> super().setUp()
> self.exec_sql(
> 'CREATE TABLE IF NOT EXISTS `test_model_update_or_create`
> (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `field` integer
> NULL);'
> )
>
> def tearDown(self):
> self.exec_sql(
> 'DROP TABLE IF EXISTS `test_model_update_or_create`;'
> )
> super().tearDown()
>
> def test_update_or_create(self):
> self.TestModel.objects.update_or_create(id=1, defaults={'field':
> 2})
> }}}

New description:

 When using with **myisam**-only database the method **update_or_create**
 can occur a TransactionManagementError exception if creating a record was
 unsuccessful (because of IntegrityError, for example the record with a
 same primary key was already created by another process).

 The problem has started after the upgrading from Django 3.2.16 to 4.1.7

 The test below just simulates a parallel insertion of the record with the
 same PK^

 Database backend: mariadb server (10.5.19) (default-storage-engine is
 **myisam**).

 This test works fine with Django 3.2.16 and fails on Django 4.1.7+:
 {{{
 class TransactionManagementErrorTest(TestCase):

 class TestModel(models.Model):
 managed = False
 field = models.IntegerField(null=True)

 class Meta(object):
 db_table = 'test_model_update_or_create'

 class QuerySet(models.QuerySet):
 def create(self, **kwargs):
 super().create(**kwargs)  # simulate parallel insertion
 return super().create(**kwargs)

 class TestModelManager(models.Manager.from_queryset(QuerySet)):
 pass

 objects = TestModelManager()

 def exec_sql(self, sql):
 from django.db import connections, router
 db = router.db_for_write(self.TestModel)
 connection = connections[db]
 connection.cursor().execute(sql)

 def setUp(self):
 super().setUp()
 self.exec_sql(
 'CREATE TABLE IF NOT EXISTS `test_model_update_or_create`
 (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `field` integer NULL);'
 )

 def tearDown(self):
 self.exec_sql(
 'DROP TABLE IF EXISTS `test_model_update_or_create`;'
 )
 super().tearDown()

 def test_update_or_create(self):
 self.TestModel.objects.update_or_create(id=1, defaults={'field':
 2})
 }}}

 **Exception**: django.db.transaction.TransactionManagementError: An error
 occurred in the current transaction. You can't execute queries until the
 end of the 'atomic' block.

 **Failure stack:**
 {{{
 Traceback (most recent call last):
   File
 "/home/alex/workspace/test_TransactionManagementError/mysite/polls/tests.py",
 line 47, in test_update_or_create
 self.TestModel.objects.update_or_create(id=1, defaults={'field': 2})
   File
 "/home/alex/workspace/test_TransactionManagementError/.venv/lib/python3.9
 /site-packages/django/db/models/manager.py", line 87, in manager_method
 return getattr(self.get_queryset(), name)(*args, **kwargs)
  

Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  index_together,  | Triage Stage:
  warning|  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mateusz Legięcki):

 * needs_better_patch:  0 => 1
 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c7d9434d-5ba49c35-7506-4a87-b4bc-ac1e7746e8b1-00%40eu-central-1.amazonses.com.


Re: [Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
 Reporter:  Mateusz Legięcki |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  index_together,  | Triage Stage:
  warning|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mateusz Legięcki):

 * Attachment "patch.diff" added.

 suggestetd patch (without tests)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c7d7af72-16788282-86c2-47cc-a8b5-26a5734236ec-00%40eu-central-1.amazonses.com.


[Django] #34525: index_together warning after migration to new style

2023-04-28 Thread Django
#34525: index_together warning after migration to new style
-+-
   Reporter:  Mateusz|  Owner:  nobody
  Legięcki   |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  4.2
  layer (models, ORM)|   Keywords:  index_together,
   Severity:  Normal |  warning
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 I've got deprecation warning about `index_together` after migration to new
 style with `model.Index(fields=[...])`. I'm using pytest as test suite. I
 created minimal example, it is available on my GH:
 https://github.com/Behoston/idx_to_bug

 logs:

 {{{
 x/tests.py::test_x
   /home/behoston/venv/idx_to/lib/python3.11/site-
 packages/django/db/models/options.py:210: RemovedInDjango51Warning:
 'index_together' is deprecated. Use 'Meta.indexes' in 'x.Item' instead.
 warnings.warn(

 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

 }}}


 For fresh indexes it works fine (no warning), so I assume that problem is
 only during migrations when models from migrations files are evaluated.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c7c95510-2c0df5d6-cb0d-45f0-9d28-97520c29ccc5-00%40eu-central-1.amazonses.com.


Re: [Django] #34504: SSLCertVerificationError on outgoing emails for some mailboxes

2023-04-28 Thread Django
#34504: SSLCertVerificationError on outgoing emails for some mailboxes
-+-
 Reporter:  Kamen Kalchev|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  smtplib, ssl,| Triage Stage:
  Django4.2  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kamen Kalchev):

 Looks good, Mariusz. Thank you once again for looking into this ticket.

 Replying to [comment:6 Mariusz Felisiak]:
 > Kamen, what do you think about adding a backward incompatibility note?
 see [https://github.com/django/django/pull/16812 PR].

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c790cd64-9abb8c3f-c885-4d8e-b1a6-3adab092706d-00%40eu-central-1.amazonses.com.


Re: [Django] #34118: Python 3.12 compatibility

2023-04-28 Thread Django
#34118: Python 3.12 compatibility
-+-
 Reporter:  Mariusz Felisiak |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"4f343a10f765c4a6672c8ef4c39d044dd7d6653f" 4f343a1]:
 {{{
 #!CommitTicketReference repository=""
 revision="4f343a10f765c4a6672c8ef4c39d044dd7d6653f"
 [4.2.x] Refs #34118, Refs #34504 -- Added backward incompatibility note
 about EmailBackend.ssl_context.

 Follow up to 2848e5d0ce5cf3c31fe87525536093b21d570f69.
 Backport of 5a6d4d3bfde07daab9777545694beb014c832264 from main
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c789e2f8-c72ef139-0c23-4723-a1a1-09585c2a0a14-00%40eu-central-1.amazonses.com.


Re: [Django] #34504: SSLCertVerificationError on outgoing emails for some mailboxes

2023-04-28 Thread Django
#34504: SSLCertVerificationError on outgoing emails for some mailboxes
-+-
 Reporter:  Kamen Kalchev|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  smtplib, ssl,| Triage Stage:
  Django4.2  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"4f343a10f765c4a6672c8ef4c39d044dd7d6653f" 4f343a1]:
 {{{
 #!CommitTicketReference repository=""
 revision="4f343a10f765c4a6672c8ef4c39d044dd7d6653f"
 [4.2.x] Refs #34118, Refs #34504 -- Added backward incompatibility note
 about EmailBackend.ssl_context.

 Follow up to 2848e5d0ce5cf3c31fe87525536093b21d570f69.
 Backport of 5a6d4d3bfde07daab9777545694beb014c832264 from main
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c789e2b4-2665970c-0189-43a0-8d8d-9c1a8f8cd6c8-00%40eu-central-1.amazonses.com.


Re: [Django] #34504: SSLCertVerificationError on outgoing emails for some mailboxes

2023-04-28 Thread Django
#34504: SSLCertVerificationError on outgoing emails for some mailboxes
-+-
 Reporter:  Kamen Kalchev|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  smtplib, ssl,| Triage Stage:
  Django4.2  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"5a6d4d3bfde07daab9777545694beb014c832264" 5a6d4d3b]:
 {{{
 #!CommitTicketReference repository=""
 revision="5a6d4d3bfde07daab9777545694beb014c832264"
 Refs #34118, Refs #34504 -- Added backward incompatibility note about
 EmailBackend.ssl_context.

 Follow up to 2848e5d0ce5cf3c31fe87525536093b21d570f69.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c789382a-defbc076-14f9-4a42-a325-f6ecabc3b31c-00%40eu-central-1.amazonses.com.


Re: [Django] #34118: Python 3.12 compatibility

2023-04-28 Thread Django
#34118: Python 3.12 compatibility
-+-
 Reporter:  Mariusz Felisiak |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"5a6d4d3bfde07daab9777545694beb014c832264" 5a6d4d3b]:
 {{{
 #!CommitTicketReference repository=""
 revision="5a6d4d3bfde07daab9777545694beb014c832264"
 Refs #34118, Refs #34504 -- Added backward incompatibility note about
 EmailBackend.ssl_context.

 Follow up to 2848e5d0ce5cf3c31fe87525536093b21d570f69.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c789384f-3b345917-53d3-4e8f-8f56-a9a3d279aaff-00%40eu-central-1.amazonses.com.


Re: [Django] #34521: Use __slots__ for template Node classes

2023-04-28 Thread Django
#34521: Use __slots__ for template Node classes
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Keryn Knight):

 * cc: Keryn Knight (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c76b82ab-5c691b81-b180-4540-abad-e0f9d58a3041-00%40eu-central-1.amazonses.com.


Re: [Django] #34524: Error while sending TLS smtp email on "self-signed certificate" server

2023-04-28 Thread Django
#34524: Error while sending TLS smtp email on "self-signed certificate" server
-+--
 Reporter:  Buky |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  ssl  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Buky):

 Hello Mariusz and thank for the quick reply,

 I looked at the patch note of the version 4.2.1 but I didn't see any
 mention of backward incompatibility for SSL. So, it's a good idea to add
 it.

 Thank for the quick merge request.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c75543c9-64a0b3d5-43fb-4bc1-96a1-4ad98c5c9408-00%40eu-central-1.amazonses.com.


Re: [Django] #34504: SSLCertVerificationError on outgoing emails for some mailboxes

2023-04-28 Thread Django
#34504: SSLCertVerificationError on outgoing emails for some mailboxes
-+-
 Reporter:  Kamen Kalchev|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  smtplib, ssl,| Triage Stage:
  Django4.2  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Kamen, what do you think about adding a backward incompatibility note? see
 [https://github.com/django/django/pull/16812 PR].

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c71fd2a5-92150344-3c0f-4507-99e7-f903ec86453a-00%40eu-central-1.amazonses.com.


Re: [Django] #34504: SSLCertVerificationError on outgoing emails for some mailboxes

2023-04-28 Thread Django
#34504: SSLCertVerificationError on outgoing emails for some mailboxes
-+-
 Reporter:  Kamen Kalchev|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  smtplib, ssl,| Triage Stage:
  Django4.2  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 #34524 was a duplicate.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c714363f-5f331c60-7a7c-4fd8-a8c5-2c100153dd11-00%40eu-central-1.amazonses.com.


Re: [Django] #34524: Error while sending TLS smtp email on "self-signed certificate" server

2023-04-28 Thread Django
#34524: Error while sending TLS smtp email on "self-signed certificate" server
-+--
 Reporter:  Buky |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  ssl  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 #34386 will be released in Django 4.2.1.

 This is a duplicate of #34504. You can subclass `EmailBackend` and
 [https://code.djangoproject.com/ticket/34504#comment:3 override]
 `ssl_context` to avoid host verification (but I would advise against it.)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c70a6e96-cd0ce629-f7d2-4e04-91ec-65e9ce178d41-00%40eu-central-1.amazonses.com.


Re: [Django] #34524: Error while sending TLS smtp email on "self-signed certificate" server

2023-04-28 Thread Django
#34524: Error while sending TLS smtp email on "self-signed certificate" server
-+--
 Reporter:  Buky |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:  ssl  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Description changed by Buky:

Old description:

> The issue appears in Django 4.2 (tested with Python 3.11 and Python 3.9).
> Correctly works with previous versions of Django: 3.2 and 4.1
>
> Context: I use locally use the [https://proton.me/support/protonmail-
> bridge-install protonmail-bridge] solution that locally bind an `IMAP`
> and `SMTP` ports with `STARTTLS`. Then, I use in my project config the
> [https://docs.djangoproject.com/en/4.2/topics/email/#smtp-backend
> EmailBackend] to connect to the solution and send emails.
>
> Here is the traceback, when I try to send emails with Django 4.2:
> {{{
> Traceback (most recent call last):
>   File "/home/user/my-project/manage.py", line 15, in 
> execute_from_command_line(sys.argv)
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/__init__.py", line 442, in
> execute_from_command_line
> utility.execute()
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/__init__.py", line 436, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/base.py", line 412, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/base.py", line 458, in execute
> output = self.handle(*args, **options)
>  ^
>   File "/home/user/my-project/my-app/management/commands/send-mail.py",
> line 62, in handle
> send_mail(f"[My subject] {options['subject']}",
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/__init__.py", line 87, in send_mail
> return mail.send()
>^^^
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/message.py", line 298, in send
> return self.get_connection(fail_silently).send_messages([self])
>
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/backends/smtp.py", line 127, in send_messages
> new_conn_created = self.open()
>^^^
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/backends/smtp.py", line 92, in open
> self.connection.starttls(context=self.ssl_context)
>   File "/usr/lib/python3.11/smtplib.py", line 790, in starttls
> self.sock = context.wrap_socket(self.sock,
> ^^
>   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
> return self.sslsocket_class._create(
>^
>   File "/usr/lib/python3.11/ssl.py", line 1075, in _create
> self.do_handshake()
>   File "/usr/lib/python3.11/ssl.py", line 1346, in do_handshake
> self._sslobj.do_handshake()
> ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: self-signed certificate (_ssl.c:992)
> }}}
>
> I found [https://code.djangoproject.com/ticket/34386 another ticket]
> recently created ticket related to SSL issue, but the issue doesn't
> exactly the same and the issue doesn't precisely mention when the patch
> will be merged: `[4.2.x] Fixed`.
>
> I have tried to export the TLS certificate and key of the solution and
> add them in my `settings.py` like:
> {{{
> EMAIL_SSL_CERTFILE="/tmp/cert.pem"
> EMAIL_SSL_KEYFILE="/tmp/key.pem"
> }}}
> And to put them in the trust store of the system:
> {{{
> cp /tmp/cert.pem /usr/local/share/ca-certificates/protonmail-bridge.crt
> cp /tmp/key.pem /etc/ssl/private/protonmail-bridge.key
> update-ca-certificates
> }}}
> But both fixes tested didn't work.

New description:

 The issue appears in Django 4.2 (tested with Python 3.11 and Python 3.9).
 Correctly works with previous versions of Django: 3.2 and 4.1

 Context: I use locally use the [https://proton.me/support/protonmail-
 bridge-install protonmail-bridge] solution that locally bind an `IMAP` and
 `SMTP` ports with `STARTTLS`. Then, I use in my project config the
 [https://docs.djangoproject.com/en/4.2/topics/email/#smtp-backend
 EmailBackend] to connect to the solution 

Re: [Django] #34524: Error while sending TLS smtp email on "self-signed certificate" server

2023-04-28 Thread Django
#34524: Error while sending TLS smtp email on "self-signed certificate" server
-+--
 Reporter:  Buky |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:  ssl  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Description changed by Buky:

Old description:

> The issue appears in Django 4.2 (tested with Python 3.11 and Python 3.9).
> Correctly works with previous versions of Django: 3.2 and 4.1
>
> Context: I use locally use the [https://proton.me/support/protonmail-
> bridge-install protonmail-bridge] solution that locally bind an `IMAP`
> and `SMTP` ports with `STARTTLS`. Then, I use in my project config the
> [https://docs.djangoproject.com/en/4.2/topics/email/#smtp-backend
> EmailBackend] to connect to the solution and send emails.
>
> Here is the traceback, when I try to send emails with Django 4.2:
> {{{
> Traceback (most recent call last):
>   File "/home/user/my-project/manage.py", line 15, in 
> execute_from_command_line(sys.argv)
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/__init__.py", line 442, in
> execute_from_command_line
> utility.execute()
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/__init__.py", line 436, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/base.py", line 412, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/management/base.py", line 458, in execute
> output = self.handle(*args, **options)
>  ^
>   File "/home/user/my-project/my-app/management/commands/send-mail.py",
> line 62, in handle
> send_mail(f"[My subject] {options['subject']}",
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/__init__.py", line 87, in send_mail
> return mail.send()
>^^^
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/message.py", line 298, in send
> return self.get_connection(fail_silently).send_messages([self])
>
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/backends/smtp.py", line 127, in send_messages
> new_conn_created = self.open()
>^^^
>   File "/home/user/.virtualenvs/env/lib/python3.11/site-
> packages/django/core/mail/backends/smtp.py", line 92, in open
> self.connection.starttls(context=self.ssl_context)
>   File "/usr/lib/python3.11/smtplib.py", line 790, in starttls
> self.sock = context.wrap_socket(self.sock,
> ^^
>   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
> return self.sslsocket_class._create(
>^
>   File "/usr/lib/python3.11/ssl.py", line 1075, in _create
> self.do_handshake()
>   File "/usr/lib/python3.11/ssl.py", line 1346, in do_handshake
> self._sslobj.do_handshake()
> ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: self-signed certificate (_ssl.c:992)
> }}}
>
> I found [https://code.djangoproject.com/ticket/34386 another ticket]
> recently created ticket related to SSL issue, but the issue doesn't
> exactly the same and the issue doesn't precisely mention when the patch
> will be merged: `[4.2.x] Fixed`.
>
> I have tried to export the TLS certificate and key of the solution and
> add them in my `settings.py` like:
> {{{
> EMAIL_SSL_CERTFILE="/tmp/cert.pem"
> EMAIL_SSL_KEYFILE="/tmp/key.pem"
> }}}
> And to put them in the trust store of the system:
> {{{
> cp /tmp/cert.pem /usr/local/share/ca-certificates/protonmail-bridge.crt
> cp /tmp/key.pem /etc/ssl/privateprotonmail-bridge.key
> update-ca-certificates
> }}}
> But both fixes tested didn't work.

New description:

 The issue appears in Django 4.2 (tested with Python 3.11 and Python 3.9).
 Correctly works with previous versions of Django: 3.2 and 4.1

 Context: I use locally use the [https://proton.me/support/protonmail-
 bridge-install protonmail-bridge] solution that locally bind an `IMAP` and
 `SMTP` ports with `STARTTLS`. Then, I use in my project config the
 [https://docs.djangoproject.com/en/4.2/topics/email/#smtp-backend
 EmailBackend] to connect to the solution 

[Django] #34524: Error while sending TLS smtp email on "self-signed certificate" server

2023-04-28 Thread Django
#34524: Error while sending TLS smtp email on "self-signed certificate" server
---+
   Reporter:  Buky |  Owner:  nobody
   Type:  Bug  | Status:  new
  Component:  Core (Mail)  |Version:  4.2
   Severity:  Normal   |   Keywords:  ssl
   Triage Stage:  Unreviewed   |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+
 The issue appears in Django 4.2 (tested with Python 3.11 and Python 3.9).
 Correctly works with previous versions of Django: 3.2 and 4.1

 Context: I use locally use the [https://proton.me/support/protonmail-
 bridge-install protonmail-bridge] solution that locally bind an `IMAP` and
 `SMTP` ports with `STARTTLS`. Then, I use in my project config the
 [https://docs.djangoproject.com/en/4.2/topics/email/#smtp-backend
 EmailBackend] to connect to the solution and send emails.

 Here is the traceback, when I try to send emails with Django 4.2:
 {{{
 Traceback (most recent call last):
   File "/home/user/my-project/manage.py", line 15, in 
 execute_from_command_line(sys.argv)
   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/management/__init__.py", line 442, in
 execute_from_command_line
 utility.execute()
   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/management/__init__.py", line 436, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/management/base.py", line 412, in run_from_argv
 self.execute(*args, **cmd_options)
   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/management/base.py", line 458, in execute
 output = self.handle(*args, **options)
  ^
   File "/home/user/my-project/my-app/management/commands/send-mail.py",
 line 62, in handle
 send_mail(f"[My subject] {options['subject']}",
   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/mail/__init__.py", line 87, in send_mail
 return mail.send()
^^^
   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/mail/message.py", line 298, in send
 return self.get_connection(fail_silently).send_messages([self])

   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/mail/backends/smtp.py", line 127, in send_messages
 new_conn_created = self.open()
^^^
   File "/home/user/.virtualenvs/env/lib/python3.11/site-
 packages/django/core/mail/backends/smtp.py", line 92, in open
 self.connection.starttls(context=self.ssl_context)
   File "/usr/lib/python3.11/smtplib.py", line 790, in starttls
 self.sock = context.wrap_socket(self.sock,
 ^^
   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
 return self.sslsocket_class._create(
^
   File "/usr/lib/python3.11/ssl.py", line 1075, in _create
 self.do_handshake()
   File "/usr/lib/python3.11/ssl.py", line 1346, in do_handshake
 self._sslobj.do_handshake()
 ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
 verify failed: self-signed certificate (_ssl.c:992)
 }}}

 I found [https://code.djangoproject.com/ticket/34386 another ticket]
 recently created ticket related to SSL issue, but the issue doesn't
 exactly the same and the issue doesn't precisely mention when the patch
 will be merged: `[4.2.x] Fixed`.

 I have tried to export the TLS certificate and key of the solution and add
 them in my `settings.py` like:
 {{{
 EMAIL_SSL_CERTFILE="/tmp/cert.pem"
 EMAIL_SSL_KEYFILE="/tmp/key.pem"
 }}}
 And to put them in the trust store of the system:
 {{{
 cp /tmp/cert.pem /usr/local/share/ca-certificates/protonmail-bridge.crt
 cp /tmp/key.pem /etc/ssl/privateprotonmail-bridge.key
 update-ca-certificates
 }}}
 But both fixes tested didn't work.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c6f2730f-77f18a33-c2c7-4a88-b347-75ec4d6c5f02-00%40eu-central-1.amazonses.com.


Re: [Django] #34515: Translatable URL patterns raise 404 for non-English default language when prefix_default_language=False is used.

2023-04-28 Thread Django
#34515: Translatable URL patterns raise 404 for non-English default language 
when
prefix_default_language=False is used.
-+-
 Reporter:  ab   |Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  4.2
  Internationalization   |
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, i18n,|
  prefix_default_language,   |
  i18n_patterns  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Alternative [https://github.com/django/django/pull/16810 PR].

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c6cd8187-8c2f949c-ae4d-4ad1-95dc-72dda2eb801e-00%40eu-central-1.amazonses.com.


Re: [Django] #33759: Using subquery to filter a model delete generates a sub-optimal SQL

2023-04-28 Thread Django
#33759: Using subquery to filter a model delete generates a sub-optimal SQL
-+-
 Reporter:  Christofer Bertonha  |Owner:  Aman
 Type:   |  Pandey
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  4.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Aman Pandey):

 * has_patch:  0 => 1
 * needs_tests:  0 => 1


Comment:

 Draft PR up https://github.com/django/django/pull/16809

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187c686e47f-88b87e87-9866-48fd-84e1-88579b781699-00%40eu-central-1.amazonses.com.