changeset 5174:65872885d876

Merge stable
author Mads Kiilerich <madski@unity3d.com>
date Tue, 09 Jun 2015 22:46:40 +0200
parents d7f13c2a28ba (current diff) a73f98871e2b (diff)
children 18b0e4d1ae58
files kallithea/lib/helpers.py
diffstat 4 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CONTRIBUTORS	Mon Jun 01 17:40:31 2015 +0200
+++ b/CONTRIBUTORS	Tue Jun 09 22:46:40 2015 +0200
@@ -74,3 +74,7 @@
     Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
     Tuux <tuxa@galaxie.eu.org>
     Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
+    Kevin Bullock <kbullock@ringworld.org>
+    Marc Villetard <marc.villetard@gmail.com>
+    Matthias Zilk <matthias.zilk@gmail.com>
+    Tim Freund <tim@freunds.net>
--- a/kallithea/controllers/files.py	Mon Jun 01 17:40:31 2015 +0200
+++ b/kallithea/controllers/files.py	Tue Jun 09 22:46:40 2015 +0200
@@ -556,7 +556,7 @@
             cached_archive_path = os.path.join(CONFIG['archive_cache_dir'], archive_name)
             if os.path.isfile(cached_archive_path):
                 log.debug('Found cached archive in %s' % cached_archive_path)
-                fd, archive = None, cached_archive_path
+                archive = cached_archive_path
                 use_cached_archive = True
             else:
                 log.debug('Archive %s is not yet cached' % (archive_name))
@@ -564,6 +564,7 @@
         if not use_cached_archive:
             # generate new archive
             fd, archive = tempfile.mkstemp()
+            os.close(fd)
             temp_stream = open(archive, 'wb')
             log.debug('Creating new temp archive in %s' % archive)
             cs.fill_archive(stream=temp_stream, kind=fileformat, subrepos=subrepos)
@@ -580,8 +581,6 @@
                 data = stream.read(16 * 1024)
                 if not data:
                     stream.close()
-                    if fd:  # fd means we used temporary file
-                        os.close(fd)
                     if not archive_cache_enabled:
                         log.debug('Destroying temp archive %s' % archive)
                         os.remove(archive)
--- a/kallithea/lib/helpers.py	Mon Jun 01 17:40:31 2015 +0200
+++ b/kallithea/lib/helpers.py	Tue Jun 09 22:46:40 2015 +0200
@@ -479,7 +479,7 @@
 
 def user_or_none(author):
     email = author_email(author)
-    if email is not None:
+    if email:
         user = User.get_by_email(email, case_insensitive=True, cache=True)
         if user is not None:
             return user
--- a/kallithea/model/forms.py	Mon Jun 01 17:40:31 2015 +0200
+++ b/kallithea/model/forms.py	Tue Jun 09 22:46:40 2015 +0200
@@ -202,7 +202,7 @@
     class _PasswordResetForm(formencode.Schema):
         allow_extra_fields = True
         filter_extra_fields = True
-        email = All(v.ValidSystemEmail(), v.Email(not_empty=True))
+        email = v.Email(not_empty=True)
     return _PasswordResetForm