Changeset 1879

Show
Ignore:
Timestamp:
11/11/08 19:30:59 (8 weeks ago)
Author:
rmarianski
Message:

add attribution license to photos uploaded to flickr (closes #377)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • siteapp/trunk/opengeo/almanac/content.py

    r1866 r1879  
    168168            photoid = result.photoid[0].text 
    169169            story.photoid = photoid 
     170            # set the license on the photo as well 
     171            # license id 5 corresponds with 
     172            # http://creativecommons.org/licenses/by-sa/2.0/ 
     173            result = flickr.photos_licenses_setLicense(photo_id=photoid, 
     174                                                       license_id=5) 
     175            assert result.attrib['stat'] == u'ok', 'Unable to set license on photo. Received: %s' % result.xml 
    170176    elif type == 'video': 
    171177        story.type = 'video' 
     
    847853            photoid = result.photoid[0].text 
    848854            self.context.photoid = photoid 
     855            # set the license on the photo as well 
     856            # license id 5 corresponds with 
     857            # http://creativecommons.org/licenses/by-sa/2.0/ 
     858            result = flickr.photos_licenses_setLicense(photo_id=photoid, 
     859                                                       license_id=5) 
     860            assert result.attrib['stat'] == u'ok', 'Unable to set license on photo. Received: %s' % result.xml 
    849861        elif self.context.type == 'video' and 'video' in self.request.form: 
    850862            self.context.body = clean_embed_markup(self.request.form['video'])