Form wizard step back

94 views
Skip to first unread message

azurIt

unread,
Nov 13, 2012, 8:17:37 AM11/13/12
to django...@googlegroups.com
Hi,

i have the following problem:
User is choosing a login in first step (login is validated and is checked if it's available) and is filling up some other data in second step. Finally, i'm trying to create a new account BUT the login can be already taken (there's a little time frame between 1 and 2 step so it's possible). How can i show the first step to the user and ask him to choose another login WITHOUT loosing any data from second step? Thxn for suggestions.

azur

Bill Freeman

unread,
Nov 13, 2012, 9:04:27 AM11/13/12
to django...@googlegroups.com

You really need to create the account, thus reserving the login (username?) in step 1, when the check succeeds (in fact, the test probably should be  an attempt to create the account, whose failure is what kicks the user back to choose another login).  You keep a creation date and note (perhaps via the lack of a validated email address) whether registration has been completed.  Then periodically run a daemon that queries for account creation attempts that are taking too long to complete, and delete them.

Bill

azurIt

unread,
Nov 13, 2012, 9:07:47 AM11/13/12
to django...@googlegroups.com
>You really need to create the account, thus reserving the login (username?)
>in step 1, when the check succeeds (in fact, the test probably should be
>an attempt to create the account, whose failure is what kicks the user back
>to choose another login). You keep a creation date and note (perhaps via
>the lack of a validated email address) whether registration has been
>completed. Then periodically run a daemon that queries for account
>creation attempts that are taking too long to complete, and delete them.


I'm creating account in the last step when i have all needed info for doing it. There must be a way how to redirect user to specified step without loosing any data.

azur

Bill Freeman

unread,
Nov 13, 2012, 9:16:33 AM11/13/12
to django...@googlegroups.com
 
Separate step is separate browser interaction.  Even if you did this with AJAX, other requests can come in in between actions.  Other users don't get blocked from accessing the site just because one is in the middle of registering.  Sorry, but that's the way the web works.

By the way, you don't need anything else to create the account.  You can fill in any required fields with place holder values, and leave login disabled until you get your real minimum.

Bill

azurIt

unread,
Nov 13, 2012, 11:51:41 AM11/13/12
to django...@googlegroups.com
>Separate step is separate browser interaction. Even if you did this with
>AJAX, other requests can come in in between actions. Other users don't get
>blocked from accessing the site just because one is in the middle of
>registering. Sorry, but that's the way the web works.
>
>By the way, you don't need anything else to create the account. You can
>fill in any required fields with place holder values, and leave login
>disabled until you get your real minimum.


This is really not a solution. No need of blocking of anything, i just need to redirect user into first step in case login gets taken in the middle of his registration. That's all :) I won't change the whole API (yes, registration is done on external server via SOAP API) because of frontend limitations.



Any other suggestions? I wonder why this can't be done. I was examinating how 'Go back' button works and this is the source:

wizard_goto_step = self.request.POST.get('wizard_goto_step', None)
if wizard_goto_step and wizard_goto_step in self.get_form_list():
self.storage.current_step = wizard_goto_step
form = self.get_form(
data=self.storage.get_step_data(self.steps.current),
files=self.storage.get_step_files(self.steps.current))
return self.render(form)


If i'm trying to simulate it in done() methond of my Form wizard object i'm always getting the first step (no matter which step i specify), all data is lost and it is even rendered completely broken (no form elements).


azur

azurIt

unread,
Nov 13, 2012, 3:15:03 PM11/13/12
to django...@googlegroups.com
for anyone having the same problem:

https://code.djangoproject.com/ticket/19285
Reply all
Reply to author
Forward
0 new messages