Commits

Anonymous committed 3b5fb8c

Load ROA_CUSTOM_ARGS just once with other ROA_* variables

Comments (0)

Files changed (1)

django_roa/db/models.py

 ROA_HEADERS = getattr(settings, 'ROA_HEADERS', {})
 ROA_FORMAT = getattr(settings, 'ROA_FORMAT', 'json')
 ROA_FILTERS = getattr(settings, 'ROA_FILTERS', {})
+ROA_CUSTOM_ARGS = getattr(settings, "ROA_CUSTOM_ARGS", {})
 
 DEFAULT_CHARSET = getattr(settings, 'DEFAULT_CHARSET', 'utf-8')
 
             pk_is_set = pk_val is not None
 
             get_args = {'format': ROA_FORMAT}
-            get_args.update(getattr(settings, "ROA_CUSTOM_ARGS", {}))
+            get_args.update(ROA_CUSTOM_ARGS)
 
             serializer = serializers.get_serializer(ROA_FORMAT)
             if hasattr(serializer, 'serialize_object'):
         logger.debug(u"""Deleting  : "%s" through %s""" % \
             (unicode(self), unicode(resource.uri)))
 
-        delete_args = getattr(settings, "ROA_CUSTOM_ARGS", {})
-        resource.delete(**delete_args)
+        resource.delete(**ROA_CUSTOM_ARGS)
 
     delete.alters_data = True
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.