[Django] #26904: CSRF middleware ignores X-CSRFToken if token not in cookies

2016-07-16 Thread Django
#26904: CSRF middleware ignores X-CSRFToken if token not in cookies
---+
 Reporter:  mrmagooey  |  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Component:  Uncategorized  |Version:  1.9
 Severity:  Normal |   Keywords:  csrf
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 This might be desired behaviour, but currently it seems that POST
 `X-CSRFToken` headers are ignored?

 It seems that this line:

 https://github.com/django/django/blob/master/django/middleware/csrf.py#L170

 will set the `csrf_token` to `None` if the token is not available in the
 Cookies header, and then this line:

 https://github.com/django/django/blob/master/django/middleware/csrf.py#L250

 will cause the middleware to return early, and never check the value of
 `X-CSRFToken` header.

 There is a comment around line 250 that this is desired behaviour, so I'm
 a bit confused. My python/django is a little rusty, so apologies if this
 is my bad.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.0afd3af3f4254b2e5688ade6db49bf09%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26883: makemessages doesn't find blocktrans if it comes after a comment in templates

2016-07-16 Thread Django
#26883: makemessages doesn't find blocktrans if it comes after a comment in
templates
-+-
 Reporter:  dAnjou   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:   |  Version:
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by audiolion):

 This could be something to do with how comments are tokenized in
 django.utils.translation
 
https://github.com/django/django/blob/master/django/utils/translation/trans_real.py#L607

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.a155a4a69330b6380c7f9a3741fae185%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26830: Issue with combination of 'with', 'ifchanged' and 'cycle' templatetags in templates.

2016-07-16 Thread Django
#26830: Issue with combination of 'with', 'ifchanged' and 'cycle' templatetags 
in
templates.
-+-
 Reporter:  flupzor  |Owner:  sergei-
 |  maertens
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  master
 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 timgraham):

 * needs_better_patch:  1 => 0


--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a198183fab5cc8d3a7d53de6b79448c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26114: Removing Meta.db_table generates migration with wrong rename in comment (None)

2016-07-16 Thread Django
#26114: Removing Meta.db_table generates migration with wrong rename in comment
(None)
+
 Reporter:  dvinegla|Owner:  PREM1980
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.9
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by PREM1980):

 The changes are made and here is the Github link.

 https://github.com/PREM1980/django

 Branch -  ticket_26114

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.14ed9f179cd29afb0b3d11d6c2e0836a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #14642: save_as=True and generic inline in admin gives IndexError

2016-07-16 Thread Django
#14642: save_as=True and generic inline in admin gives IndexError
-+-
 Reporter:  simon@…  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Forms|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:  save_as generic  | Triage Stage:  Accepted
  inline |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 #26901 is a duplicate that proposes a (perhaps partial) patch.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.2aaa0afc937d2d811bf99f4032f6780c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26901: enable "save-as-new" feature for GenericInlines / ContentTypes

2016-07-16 Thread Django
#26901: enable "save-as-new" feature for GenericInlines / ContentTypes
-+-
 Reporter:  eecp |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:   |  Version:  1.9
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  save_as_new  | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.082fe81f85fbfd355e90536adfa84a28%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26903: support date and timestamp containment within postgres range field

2016-07-16 Thread Django
#26903: support date and timestamp containment within postgres range field
--+
 Reporter:  ar45  |  Owner:
 Type:  Bug   | Status:  new
Component:  contrib.postgres  |Version:  1.9
 Severity:  Normal|   Keywords:  rangefield
 Triage Stage:  Unreviewed|  Has patch:  1
Easy pickings:  0 |  UI/UX:  0
--+
 currently trying to do a lookup

 {{{#!python
 MyModel.objects.filter(datetime_range__contains=timezone.now())
 }}}
 results in incorrect SQL.


 Pull request at https://github.com/django/django/pull/6885

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/047.9a5a8447a8a624ebdc4efe6ec5ffab86%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26901: enable "save-as-new" feature for GenericInlines / ContentTypes

2016-07-16 Thread Django
#26901: enable "save-as-new" feature for GenericInlines / ContentTypes
-+-
 Reporter:  eecp |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:   |  Version:  1.9
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:  save_as_new  | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by eecp):

 Indeed that looks very similar, sorry i missed that. My content_types_id
 error is reproducable with the model of simon@... So we can close this
 ticket. Still hope my patch lines may bring the topic a little forward.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.9e644a1ec1b3429c9bd7e350d6466143%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26180: Altering unique_together still sometimes missing deleted fields

2016-07-16 Thread Django
#26180: Altering unique_together still sometimes missing deleted fields
---+
 Reporter:  julianandrews  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Migrations |  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by akki):

 * Attachment "ticket26180-temp-fix.diff" 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.b0cfb0af2f50623437df62da53e989fe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26180: Altering unique_together still sometimes missing deleted fields

2016-07-16 Thread Django
#26180: Altering unique_together still sometimes missing deleted fields
---+
 Reporter:  julianandrews  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Migrations |  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by akki):

 The patch temporarily fixes the issue (attaching for anyone who gets stuck
 due to this bug) but some other edge cases would still get left. The
 actual fix would involve some changes in `migrations.optimizer` or the
 `reduce` methods of `AlterUniqueTogether` or `RemoveField` operations
 AFAICS.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.4ec7f5e41d8c8a24cb582feedf9cf621%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26826: dumpdata command using multiple pks that are UUIDs produces error

2016-07-16 Thread Django
#26826: dumpdata command using multiple pks that are UUIDs produces error
-+-
 Reporter:  KevinGrahamFoster|Owner:  nschagen
 Type:  Bug  |   Status:  closed
Component:  Core (Management |  Version:  1.9
  commands)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  dumpdata uuid| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"599393172b2ff5fa85e01253d4f38b697901" 59939317]:
 {{{
 #!CommitTicketReference repository=""
 revision="599393172b2ff5fa85e01253d4f38b697901"
 Fixed #26826 -- Stripped spaces from dumpdata pks arguments

 Thanks Kevin Graham Foster for the report and Tim Graham for the review.
 }}}

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.f8d5edaa6ba16410112a4dbc60f44f0a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26902: Add `secure` argument to `is_safe_url()`

2016-07-16 Thread Django
#26902: Add `secure` argument to `is_safe_url()`
-+
 Reporter:  suligap  |  Owner:  nobody
 Type:  New feature  | Status:  new
Component:  Utilities|Version:  master
 Severity:  Normal   |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  1
Easy pickings:  0|  UI/UX:  0
-+
 `django.utils.http.is_safe_url()` considers any HTTP and HTTPS url safe as
 long as its hostname matches the `host` argument. Currently this is true:
 `is_safe_url('http://example.com', host='example.com')`.

 Let's add a `secure` argument to `is_safe_url()` so that when it's `True`,
 only HTTPS is considered as a safe scheme.

 The existence of that argument alone would make users aware of potential
 issues that can arise from ignoring it. For example if a developer uses
 `is_safe_url()` to validate user supplied urls for redirection to a target
 with appended secrets as url query params.

 `django.contrib.admin` uses `django.contrib.auth` login view where
 `is_safe_url()` is used to validate the `next` query param. This scenario
 is currently possible:
 - user goes to
 https://example.net/admin/login/?next=http://example.net/admin/foo
 - they enter their credentials and POST to the above url
 - They're successfully authenticated, they receive a response with a new
 session cookie and are redirected to http://example.net/admin/foo

 Of course our HTTPS site should only set `Secure` session cookies and use
 HSTS, so there should be no possibility of the the cookie being sent by
 the user via HTTP. But if the site doesn't set secure cookies and doesn't
 use HSTS, this is a problem. If the site doesn't use secure cookies in the
 first place, then the `secure` param to `is_safe_url()` won't help much..
 but I would argue it still makes the validation more "complete".

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.e2203dfcce449264bafd61ee5572631d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26900: Defer FileFields causes errors when accessing them

2016-07-16 Thread Django
#26900: Defer FileFields causes errors when accessing them
-+-
 Reporter:  samuelmaudo  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"a03ac61332fe356a60e25d5ecd7d4cd7ee07c345" a03ac613]:
 {{{
 #!CommitTicketReference repository=""
 revision="a03ac61332fe356a60e25d5ecd7d4cd7ee07c345"
 [1.10.x] Fixed #26900 -- Fixed crash accessing deferred FileFields.

 Backport of 7c33aa8a87d323f0e8e5368705aa8ba96f9819d0 from master
 }}}

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.bc5e4e55f9ee5f60ee773e7fe4b886aa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26900: Defer FileFields causes errors when accessing them

2016-07-16 Thread Django
#26900: Defer FileFields causes errors when accessing them
-+-
 Reporter:  samuelmaudo  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 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 Tim Graham ):

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


Comment:

 In [changeset:"7c33aa8a87d323f0e8e5368705aa8ba96f9819d0" 7c33aa8a]:
 {{{
 #!CommitTicketReference repository=""
 revision="7c33aa8a87d323f0e8e5368705aa8ba96f9819d0"
 Fixed #26900 -- Fixed crash accessing deferred FileFields.
 }}}

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.2c4e1029502e14cb3dd4e9368845f753%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26901: enable "save-as-new" feature for GenericInlines / ContentTypes

2016-07-16 Thread Django
#26901: enable "save-as-new" feature for GenericInlines / ContentTypes
-+-
 Reporter:  eecp |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:   |  Version:  1.9
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:  save_as_new  | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Might be a duplicate of #14642. If not, could you please provide a test
 for Django's test suite or a sample project to reproduce the issue?

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.c90c626ca3ffcfce509c54ba82d0dcba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26826: dumpdata command using multiple pks that are UUIDs produces error

2016-07-16 Thread Django
#26826: dumpdata command using multiple pks that are UUIDs produces error
-+-
 Reporter:  KevinGrahamFoster|Owner:  nschagen
 Type:  Bug  |   Status:  assigned
Component:  Core (Management |  Version:  1.9
  commands)  |
 Severity:  Normal   |   Resolution:
 Keywords:  dumpdata uuid| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * stage:  Accepted => Ready for checkin


--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.3fae9e23ff1973555ae620740ec915fe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26826: dumpdata command using multiple pks that are UUIDs produces error

2016-07-16 Thread Django
#26826: dumpdata command using multiple pks that are UUIDs produces error
-+-
 Reporter:  KevinGrahamFoster|Owner:  nschagen
 Type:  Bug  |   Status:  assigned
Component:  Core (Management |  Version:  1.9
  commands)  |
 Severity:  Normal   |   Resolution:
 Keywords:  dumpdata uuid| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by claudep):

 * has_patch:  0 => 1


Comment:

 I found out that the problem is simply the space around the comma. While
 the ORM handles fine a `' 43 '` pk argument, it chokes on `' some-uuid
 '`.
 [https://github.com/django/django/pull/6921 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.c88e185050a623cfa1c2e9e28e8b89fa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26901: enable "save-as-new" feature for GenericInlines / ContentTypes

2016-07-16 Thread Django
#26901: enable "save-as-new" feature for GenericInlines / ContentTypes
--+-
 Reporter:  eecp  |  Owner:  nobody
 Type:  New feature   | Status:  new
Component:  contrib.contenttypes  |Version:  1.9
 Severity:  Normal|   Keywords:  save_as_new
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+-
 Hope i haven't overlooked a related ticket. I'm using Django 1.9.7 with
 some models having generic relations. Normal use like add or change with
 having those models as generic inlines in the admin of other models work
 without problem. However enabling "save_as" produces an database exception
 (content_types_id should not be not null) on executing the save (which
 would actually be an add with initial data). I tracked down the issue up
 to the definitions in "forms.py" of contenttypes.

 If one compares the __init__ of BaseGenericInlineFormSet with those of
 BaseInlineFormSet one finds that the save_as_new flag is not stored into
 self and later on there is no initial_form_count-method using this flag to
 return 0. This ultimately leads to the actual behaviour that the formset's
 save routine assumes that the freshly instantiated inline object seems to
 already exist in the database and therefore gets never assigned any
 content_types_id related to the "parent object".

 I made a patch on my system like this:
 {{{
 @@ -15,6 +15,7 @@
   prefix=None, queryset=None, **kwargs):
  opts = self.model._meta
  self.instance = instance
 +self.save_as_new = save_as_new
  self.rel_name = '-'.join((
  opts.app_label, opts.model_name,
  self.ct_field.name, self.ct_fk_field.name,
 @@ -35,14 +36,24 @@
  **kwargs
  )

 +def initial_form_count(self):
 +if self.save_as_new:
 +return 0
 +return super(BaseGenericInlineFormSet, self).initial_form_count()
 +
 }}}
 As i'm no hardcore coder i assume that maybe there is more to it and this
 patch should only be considered as partial.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/047.d23604827d5f69aea7fc7230d5ee0cd5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #17209: Dogfood class-based views in contrib.auth

2016-07-16 Thread Django
#17209: Dogfood class-based views in contrib.auth
-+-
 Reporter:  melinath |Owner:  Claude
 Type:   |  Paroz 
  Cleanup/optimization   |   Status:  closed
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  class-based views| Triage Stage:  Ready for
  admin auth |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz ):

 * owner:   => Claude Paroz 
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"255fb992845e987ef36e3d721a77747a0b2df620" 255fb992]:
 {{{
 #!CommitTicketReference repository=""
 revision="255fb992845e987ef36e3d721a77747a0b2df620"
 Fixed #17209 -- Added password reset/change class-based views

 Thanks Tim Graham for the review.
 }}}

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.ac656bf1e54f4d81ae0512cec756919d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.