edit_post redirection errors out to 404

0 views
Skip to first unread message

johnnie...@gmail.com

unread,
Feb 21, 2007, 12:39:52 PM2/21/07
to snapboard-discuss
snapboard revision 136, django revision 4527

When I revise a post via the editpost link, I get redirected to the
following url when I click on update:

/forums/edit_post/3/#snap_post4

This raises a 404. Initially looking at the edit_post view, I see the
following lines:

try:
next = request.POST['next'].split('#')[0] + '#snap_post' +
str(div_id_num)
except KeyError:
next = SNAP_PREFIX + '/threads/id/' + str(orig_post.thread.id)
+ '/'

When place an assert False right after this series of statements, the
next variable is assigned "#snap_post12". This seems to indicate that
lookup for the "next" key in the POST dict is failing.

I don't have time to continue debugging right now, so I'm firing this
post off to find out if you've run into the same problem. Not going
to file as a bug until I find out with it's a known issue or just me.

Bo Shi

unread,
Feb 21, 2007, 4:18:30 PM2/21/07
to snapboar...@googlegroups.com
Can't reproduce this. Can you give me exactly the process you used to
produce the 404?

johnnie...@gmail.com

unread,
Feb 21, 2007, 4:30:34 PM2/21/07
to snapboard-discuss
Yep:

1. Follow the create a new topic link.
2. Enter some text and click on Start Subject.
3. Edit the post using the edit post link.
4. Alter some of the text and click on update.

you should error out with a 404.

On Feb 21, 1:18 pm, "Bo Shi" <bs1...@gmail.com> wrote:
> Can't reproduce this. Can you give me exactly the process you used to
> produce the 404?
>

Bo Shi

unread,
Feb 21, 2007, 4:40:03 PM2/21/07
to snapboar...@googlegroups.com
Hrm... still can't get it to 404 out. Can you try to generate the
error from the following page? Perhaps this issue is resulting from
some bad configuration options on my part.

http://snapboard.deadpuck.net/threads/

johnnie...@gmail.com

unread,
Feb 21, 2007, 4:57:54 PM2/21/07
to snapboard-discuss
ok, well I registered with your instance of the boards but haven't
received a mail yet.

try my instance:

http://www.peepz.net:8080/accounts/register/

On Feb 21, 1:40 pm, "Bo Shi" <bs1...@gmail.com> wrote:
> Hrm... still can't get it to 404 out. Can you try to generate the
> error from the following page? Perhaps this issue is resulting from
> some bad configuration options on my part.
>
> http://snapboard.deadpuck.net/threads/
>

Bo Shi

unread,
Feb 21, 2007, 5:03:55 PM2/21/07
to snapboar...@googlegroups.com
:) Google thinks it's spam. Check your spam box. I'll try your instance now.

Bo Shi

unread,
Feb 21, 2007, 5:05:30 PM2/21/07
to snapboar...@googlegroups.com
Works for me. This must be a javascript problem. What browser are you using?

Bo Shi

unread,
Feb 21, 2007, 5:06:11 PM2/21/07
to snapboar...@googlegroups.com
woa, scratch that. doesn't work.

johnnie...@gmail.com

unread,
Feb 21, 2007, 5:13:20 PM2/21/07
to snapboard-discuss
Yeah, picked it up outta the spam bucket.

It definitely works in your environment. I'm so doing something wrong
here.

On Feb 21, 2:06 pm, "Bo Shi" <bs1...@gmail.com> wrote:
> woa, scratch that. doesn't work.
>
> On 2/21/07, Bo Shi <bs1...@gmail.com> wrote:
>
> > Works for me. This must be a javascript problem. What browser are you using?
>
> > On 2/21/07, Bo Shi <bs1...@gmail.com> wrote:
> > > :) Google thinks it's spam. Check your spam box. I'll try your instance now.
>

johnnie...@gmail.com

unread,
Feb 21, 2007, 8:19:47 PM2/21/07
to snapboard-discuss
ok, I'm at a loss. I've set the app up in isolation from the
examplesite directory, running a local server via the runserver
command. edit post works great.

When I run it as apart of my project site, it totally fails. So I did
the following to the edit_post function:

try:
# next = request.POST['next'].split('#')[0] + '#snap_post' +
str(div_id_num)
#except KeyError:


next = SNAP_PREFIX + '/threads/id/' + str(orig_post.thread.id)
+ '/'

except:
raise Http404

And it worked fine. For some reason in my environment,
request.POST['next'] is empty. It's failing because the redirect is
relative.

btw, sorry about missing your chat request. I'm available whenever.


On Feb 21, 2:13 pm, "johnnie.pitt...@gmail.com"

Reply all
Reply to author
Forward
0 new messages