Have trans.user_ftp_dir return None instead of error if ftp_upload_dir unset.

This is now called on each upload job eb538e00bd and if ftp_upload_dir is None and this was throwing the following exception - https://gist.github.com/jmchilton/fdfb808e13998fbe17bd.
This commit is contained in:
John Chilton
2015-05-14 09:42:03 -04:00
parent 687a8947e2
commit 851186dc7f
+5 -1
View File
@@ -139,7 +139,11 @@ class ProvidesUserContext( object ):
@property
def user_ftp_dir( self ):
identifier = self.app.config.ftp_upload_dir_identifier
return os.path.join( self.app.config.ftp_upload_dir, getattr( self.user, identifier ) )
base_dir = self.app.config.ftp_upload_dir
if base_dir is None:
return None
else:
return os.path.join( base_dir, getattr( self.user, identifier ) )
class ProvidesHistoryContext( object ):