diff foodtruck/views/edit.py @ 761:4d8e82641597

admin: Don't crash when the site isn't in a source control repository.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 30 Jun 2016 22:36:10 -0700
parents a920b2ab1f31
children 3885421c29a3
line wrap: on
line diff
--- a/foodtruck/views/edit.py	Sat Jun 25 17:18:26 2016 -0700
+++ b/foodtruck/views/edit.py	Thu Jun 30 22:36:10 2016 -0700
@@ -43,7 +43,8 @@
             if not message:
                 message = "Edit %s" % os.path.relpath(
                     page.path, site_app.root_dir)
-            site.scm.commit([page.path], message)
+            if site.scm:
+                site.scm.commit([page.path], message)
 
         if 'do_preview' in request.form:
             return _preview_page(page)