Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove unnecessary check on __set__ parameters.

  • Loading branch information...
commit a22e15effc957df977233c64278b364a955b9ce9 1 parent bc46f67
Mike Fogel authored May 07, 2013
6  django/contrib/contenttypes/generic.py
@@ -137,9 +137,6 @@ def __get__(self, instance, instance_type=None):
137 137
             return rel_obj
138 138
 
139 139
     def __set__(self, instance, value):
140  
-        if instance is None:
141  
-            raise AttributeError("%s must be accessed via instance" % self.related.opts.object_name)
142  
-
143 140
         ct = None
144 141
         fk = None
145 142
         if value is not None:
@@ -280,9 +277,6 @@ def __get__(self, instance, instance_type=None):
280 277
         return manager
281 278
 
282 279
     def __set__(self, instance, value):
283  
-        if instance is None:
284  
-            raise AttributeError("Manager must be accessed via instance")
285  
-
286 280
         manager = self.__get__(instance)
287 281
         manager.clear()
288 282
         for obj in value:
15  django/db/models/fields/related.py
@@ -206,9 +206,6 @@ def __get__(self, instance, instance_type=None):
@@ -312,9 +309,6 @@ def __get__(self, instance, instance_type=None):
@@ -384,9 +378,6 @@ def __get__(self, instance, instance_type=None):
@@ -767,9 +758,6 @@ def __get__(self, instance, instance_type=None):
@@ -824,9 +812,6 @@ def __get__(self, instance, instance_type=None):

0 notes on commit a22e15e

Please sign in to comment.
Something went wrong with that request. Please try again.