Changes between Initial Version and Version 6 of Ticket #24418


Ignore:
Timestamp:
Mar 9, 2015, 11:28:26 AM (10 years ago)
Author:
Johannes Lerch
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24418

    • Property Severity NormalRelease blocker
    • Property Triage Stage UnreviewedReady for checkin
    • Property Type UncategorizedBug
    • Property Has patch set
    • Property Resolutionfixed
    • Property Status newclosed
  • Ticket #24418 – Description

    initial v6  
    11If i try to call refresh_from_db on a model instance that has a foreignkey set to null, i get an error:
    22
    3 {{{
    4 Traceback:
    5 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
    6   112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
    7 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
    8   465.                 return self.admin_site.admin_view(view)(*args, **kwargs)
    9 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
    10   99.                     response = view_func(request, *args, **kwargs)
    11 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
    12   52.         response = view_func(request, *args, **kwargs)
    13 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
    14   198.             return view(request, *args, **kwargs)
    15 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
    16   29.             return bound_func(*args, **kwargs)
    17 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
    18   99.                     response = view_func(request, *args, **kwargs)
    19 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
    20   25.                 return func(self, *args2, **kwargs2)
    21 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
    22   371.                 return func(*args, **kwargs)
    23 File "/home/johannes/formonauts/donation/.env/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view
    24   1164.                 self.save_model(request, new_object, form, False)
    25 File "/home/johannes/formonauts/donation/server/django-donut/donut/admin.py" in save_model
    26   36.                 obj.save()
    27 File "/home/johannes/formonauts/donation/server/django-donut/nanny/models.py" in save
    28   109.                 self.refresh_from_db()
    29 File "/home/johannes/formonauts/donation/server/django-donut/donut/basemodels.py" in refresh_from_db
    30   80.                 related_val = getattr(rel_instance, field.related_field.attname)
    31 
    32 Exception Type: AttributeError at /admin/nanny/team/add/
    33 Exception Value: 'NoneType' object has no attribute 'id'
    34 }}}
     3(stacktrace was removed after ticket was resolved)
    354
    365here rel_instance is assigned:
Back to Top