comparison foodtruck/views/create.py @ 770:a7726e4862c4

admin: Fix API changes, don't crash the dashboard on non-binary WIP files. Treat new/edited files that have no `auto_format` supported extension as "miscellaneous" files, which are shown separately on the dashboard.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 02 Jul 2016 01:30:51 -0700
parents 14c51f5accc9
children 3885421c29a3
comparison
equal deleted inserted replaced
769:d841716d8e0d 770:a7726e4862c4
43 os.makedirs(os.path.dirname(fac.path), exist_ok=True) 43 os.makedirs(os.path.dirname(fac.path), exist_ok=True)
44 with open(fac.path, 'w', encoding='utf8') as fp: 44 with open(fac.path, 'w', encoding='utf8') as fp:
45 fp.write('') 45 fp.write('')
46 flash("%s was created." % os.path.relpath(fac.path, site.root_dir)) 46 flash("%s was created." % os.path.relpath(fac.path, site.root_dir))
47 47
48 route = site.getRoute(source.name, fac.metadata, 48 route = site.getSourceRoute(source.name, fac.metadata)
49 skip_taxonomies=True)
50 if route is None: 49 if route is None:
51 logger.error("Can't find route for page: %s" % fac.path) 50 logger.error("Can't find route for page: %s" % fac.path)
52 abort(500) 51 abort(500)
53 52
54 dummy = _DummyPage(fac) 53 dummy = _DummyPage(fac)