supercodepoet/django-merlin

django-merlin eats exceptions and returns a 404?

Closed this issue · 5 comments

Why does django-merlin seem to eat exceptions and return a 404?

If I have any errors in my code that uses django-merlin, I get a 404 with no output from django's dev server? Is there something I'm doing wrong? For example currently I'm getting a 404 after initialize() is called on my subclassed wizard:

Initialise {'form_data': {}, 'current_step': create-portlet, 'steps': [create-portlet]}

    def initialize(self, request, wizard_state):
        print('Initialise %s' % wizard_state)

My urls.py contains:

(r'^portlets/(?P[A-Za-z0-9_-]+)$', PortletWizard([Step('create-portlet', CreatePortletForm)])),

Thanks

Let me take a look at this

There are three places the django-merlin will throw a 404:

  1. If the there is no slug in the kwargs, which indicates that the url pattern might be incorrect
  2. If it can not find a step for that slug and the slug is not the special keyword 'cancel' (used to cancel a session wizard)
  3. If you use any other HTTP method beyond GET and POST. Right now it only supports those two HTTP verbs.

Can you send me a gist of your wizard and url conf and I can take a look?

I am having the same problem here...... any thoughts? Gist here: https://gist.github.com/1700054

I added some descriptions to the Http404 exceptions and it is failing because it can't find a Step with the given slug. get_steps() finds the Steps I have defined though, but with a slug=''. HOWEVER print(self.slug) in Step.init() returns the right thing?! So it seems to get lost somewhere in between there and being retrieved from the session. It remembers the form though.......

Thanks in advance.

Ok, the squashing of errors using a 404 was removed. Now custom exceptions or existing exceptions should be raised.

Sorry, this was fixed in version 0.7