Skip to content

Commit

Permalink
Merge ba69608 into 2d29af4
Browse files Browse the repository at this point in the history
  • Loading branch information
blaxter committed May 20, 2014
2 parents 2d29af4 + ba69608 commit 385b31a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 5 additions & 1 deletion achilles/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import django.dispatch
import logging
import sys
import traceback


Expand Down Expand Up @@ -49,7 +50,10 @@ def get(name):
try:
import_module(app + '.actions')
except ImportError:
pass
tb = sys.exc_info()[2]
stack = traceback.extract_tb(tb, 3)
if len(stack) > 2:
raise

return Library.get_global(name)

Expand Down
7 changes: 6 additions & 1 deletion achilles/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from inspect import isclass
from importlib import import_module
import sys
import traceback

from achilles.common import BaseLibrary, achilles_data
from achilles.actions import Library as ActionsLibrary
Expand Down Expand Up @@ -103,7 +105,10 @@ def get(name, context=None):
try:
import_module(app + '.blocks')
except ImportError:
pass
tb = sys.exc_info()[2]
stack = traceback.extract_tb(tb, 3)
if len(stack) > 2:
raise

return Library.get_global(name)(context)

Expand Down
8 changes: 7 additions & 1 deletion achilles/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from django.template import Context
from django.http.request import QueryDict
try:
from django.http.request import QueryDict
except ImportError:
from django.http import QueryDict

from achilles import blocks, actions

Expand All @@ -26,6 +29,9 @@ def get_initial(self):

def get_form(self, form_data=None, *args, **kwargs):
if not self._form:
if self.form_class is None:
raise ValueError("form_class is undefined %s" %
type(self).__name__)
self._form = self.form_class(data=form_data,
**self.get_form_kwargs())
return self._form
Expand Down

0 comments on commit 385b31a

Please sign in to comment.