#27638: Rollback data changes made inside templates
-------------------------------------------+------------------------
               Reporter:  vinay karanam    |          Owner:  nobody
                   Type:  Uncategorized    |         Status:  new
              Component:  Template system  |        Version:  master
               Severity:  Normal           |       Keywords:
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 Current implementation to prevent data changes within templates relies on
 the attribute `alters_data = True`.

 By default this is set for all `Model`, `QuerySet` and `ModelForm` methods
 that can alter data.

 But if someone overrides these methods, they need to explicitly set this
 attribute again.
 It is common to override `save` method and not set this attribute.

 Even a lot of popular third-party packages endup making this mistake.

 I propose that we rollback any data changes that are done during template
 rendering.
 Either by savepoint rollback or by setting autocommit to `False` during
 rendering.

--
Ticket URL: <https://code.djangoproject.com/ticket/27638>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.950c3bd012c407e7a9c9ba40f0d2c693%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to