FlaskBB
Community Forums
Administrator
avatar
Joined: Jul 09 2015
Posts: 113

sh4nks wrote:

tayo wrote:

tayo wrote:

And oh, it would be nice if you don't get redirected to the first page of the topic every time you post new message.

Funny, i didn't get redirected after making the post above.
It only redirects to the first page if you use the 'full reply' or 'edit' option

thanks for pointing that out :)

Should be fixed now :)

Member
Joined: Sep 17 2016
Posts: 96

Has this issue been resolved? I'm also getting the same error when trying to add a new Category or a new Forum:

TypeError: 'csrf_token' is an invalid keyword argument for Forum

Thanks,
Shal

Administrator
avatar
Joined: Jul 09 2015
Posts: 113

demo wrote:

Has this issue been resolved? I'm also getting the same error when trying to add a new Category or a new Forum:

TypeError: 'csrf_token' is an invalid keyword argument for Forum

Thanks,
Shal

Just fixed it. There were actually more places where I had to fix it.

Member
Joined: Jan 26 2017
Posts: 3

sh4nks wrote:

karloff010 wrote:

It seems that there is a general problem how sqlachemy handling 'csrf_token' in forum related operations

How come? CSRF tokens are entirely managed by Flask-WTF.

=============
Error message looks like sqlalchemy ... i face a lot of those in the past.
i've taken a look at the part where you pass it to sqlachlemy, looks like you pass along the whole wtf element which contains the csrf_token, too.


file:
flaskbb/management/forms.py

[...]
class EditForumForm(ForumForm):

id = HiddenField()

def __init__(self, forum, *args, **kwargs):
    self.forum = forum
    kwargs['obj'] = self.forum
    ForumForm.__init__(self, *args, **kwargs)

def save(self):
    data = self.data
    # remove the button
    data.pop('submit', None)
    forum = Forum(**data)
    # flush SQLA info from created instance so that it can be merged
    make_transient(forum)
    make_transient_to_detached(forum)

    return forum.save()

[...]

maybe you just need to declare it in the models

Administrator
avatar
Joined: Jul 09 2015
Posts: 113

This bug is already fixed.

Member
Joined: Mar 23 2018
Posts: 2

Validation problem with username/emails, during login.

I don't think the username/emails should be case-sensitive. For example if you registered as Demo and Demo@demo.localhost then you won't be able to login with demo or demo@demo.localhost

Silly validation bug if you ask me, but I'm a PHP guy so I don't know if Python & Flask are more anal on Validation of Forms Data.

Member
Joined: Mar 23 2018
Posts: 2

Another odd bug when trying to submit avatar url.

Image type JPEG is not allowed. Allowed types are: image/png, image/jpeg, image/gif

Given the image is a .jpg again it's same .jpeg