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.
The first time a block of code where a page is created is run, the following exception is raised:
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.