# HG changeset patch # User Brian Neal # Date 1423014729 21600 # Node ID 3d635fd53ef0379084d60a088f50212db7e59f23 # Parent f12751259f661eba0726294cab41050e32bb26fe# Parent ee47122d6277e3d7f8d9f46c68bc446872658e85 Merge with upstream. diff -r f12751259f66 -r 3d635fd53ef0 core/image_uploader.py --- a/core/image_uploader.py Tue Feb 03 19:51:12 2015 -0600 +++ b/core/image_uploader.py Tue Feb 03 19:52:09 2015 -0600 @@ -3,6 +3,7 @@ The image can be resized and a thumbnail can be generated and uploaded as well. """ +from base64 import b64encode import logging from io import BytesIO import os.path @@ -18,6 +19,11 @@ logger = logging.getLogger(__name__) +def make_key(): + """Generate a random key suitable for a filename""" + return b64encode(uuid.uuid4().bytes, '-_').rstrip('=') + + def upload(fp, bucket, metadata=None, new_size=None, thumb_size=None): """Upload an image file to a given S3Bucket. @@ -54,7 +60,7 @@ # to perform on it fail if this is the case. To get around these issues, # we make a copy of the file on the file system and operate on the copy. # First generate a unique name and temporary file path. - unique_key = uuid.uuid4().hex + unique_key = make_key() ext = os.path.splitext(fp.name)[1] temp_name = os.path.join(tempfile.gettempdir(), unique_key + ext) diff -r f12751259f66 -r 3d635fd53ef0 sg101/templates/base.html --- a/sg101/templates/base.html Tue Feb 03 19:51:12 2015 -0600 +++ b/sg101/templates/base.html Tue Feb 03 19:52:09 2015 -0600 @@ -92,9 +92,9 @@
- - Top 101 Banner + + Latin Top 61 Banner
{% block content %} {% endblock %} diff -r f12751259f66 -r 3d635fd53ef0 static/images/NSSRLatin.png Binary file static/images/NSSRLatin.png has changed