Merge branch 'main' into avm99963-monorail

Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266

GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/sitewide/projectcreate.py b/sitewide/projectcreate.py
index 37d02c8..f6c3842 100644
--- a/sitewide/projectcreate.py
+++ b/sitewide/projectcreate.py
@@ -1,7 +1,6 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
 
 """Classes for users to create a new project."""
 from __future__ import print_function
@@ -15,7 +14,7 @@
 
 import settings
 from businesslogic import work_env
-from framework import exceptions, flaskservlet
+from framework import exceptions
 from framework import filecontent
 from framework import framework_helpers
 from framework import gcs_helpers
@@ -37,7 +36,7 @@
 _MSG_MISSING_PROJECT_SUMMARY = 'Missing project summary'
 
 
-class ProjectCreate(flaskservlet.FlaskServlet):
+class ProjectCreate(servlet.Servlet):
   """Shows a page with a simple form to create a project."""
 
   _PAGE_TEMPLATE = 'sitewide/project-create-page.ezt'
@@ -115,8 +114,8 @@
       try:
         gcs_helpers.CheckMimeTypeResizable(
             filecontent.GuessContentTypeFromFilename(item.filename))
-      except gcs_helpers.UnsupportedMimeType, e:
-        mr.errors.logo = e.message
+      except gcs_helpers.UnsupportedMimeType as e:
+        mr.errors.logo = str(e)
 
     # 2. Call services layer to save changes.
     if not mr.errors.AnyErrors():
@@ -137,7 +136,7 @@
             item = post_data['logo']
             logo_file_name = item.filename
             logo_gcs_id = gcs_helpers.StoreLogoInGCS(
-                logo_file_name, item.value, project_id)
+                logo_file_name, item.read(), project_id)
             we.UpdateProject(
                 project_id, logo_gcs_id=logo_gcs_id,
                 logo_file_name=logo_file_name)