Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page slug validation gives error, but only on first run #216

Open
MPvHarmelen opened this issue Oct 25, 2013 · 0 comments
Open

Page slug validation gives error, but only on first run #216

MPvHarmelen opened this issue Oct 25, 2013 · 0 comments

Comments

@MPvHarmelen
Copy link
Owner

The first time a block of code where a page is created is run, the following exception is raised:

  File "D:\Martin\Documents\GitHub\Freevle\freevle\blueprints\cms\models.py", line 175, in validate_slug
    subcategory = self.subcategory if self.subcategory is not None else Subcategory.query.get(self.subcategory_id)
  File "C:\Program Files\Python 3.3.2\lib\site-packages\sqlalchemy\orm\query.py", line 795, in get
    if len(ident) != len(mapper.primary_key):
TypeError: object of type 'NoneType' has no len()

The second time the block of code is run, no error is raised. I sort of added a workaround by adding a try/except statement, but it's really ugly and probably buggy too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant