Merge remote-tracking branch 'is_derek/bug405_email_notifications_for_comments' into...
authorJoar Wandborg <git@wandborg.com>
Sun, 10 Jun 2012 13:53:46 +0000 (15:53 +0200)
committerJoar Wandborg <git@wandborg.com>
Sun, 10 Jun 2012 13:53:46 +0000 (15:53 +0200)
Conflicts:
mediagoblin/db/mongo/migrations.py

1  2 
mediagoblin/db/mongo/migrations.py
mediagoblin/db/sql/models.py
mediagoblin/edit/forms.py
mediagoblin/edit/views.py
mediagoblin/user_pages/views.py

index 732f5846015c029b31006b2e797425e9ae5f9897,1984ecc49ea91993094dc743300335b4eeee93b3..569dec88e068d2a2c2e53688418306d3b2391c52
@@@ -173,28 -170,9 +173,36 @@@ def convert_gps_media_data(database)
          del document['media_data']['gps']
          collection.save(document)
  
 +
  @RegisterMigration(12)
 +def convert_exif_media_data(database):
 +    """
 +    Move media_data["exif"]["clean"] to media_data["exif_all"].
 +    Drop media_data["exif"]["useful"]
 +    In preparation for media_data.exif_all
 +    """
 +    collection = database['media_entries']
 +    target = collection.find(
 +        {'media_data.exif.clean': {'$exists': True}})
 +
 +    for document in target:
 +        media_data = document['media_data']
 +
 +        exif_all = media_data['exif'].pop('clean')
 +        if len(exif_all):
 +            media_data['exif_all'] = exif_all
 +
 +        del media_data['exif']['useful']
 +
 +        assert len(media_data['exif']) == 0
 +        del media_data['exif']
 +
 +        collection.save(document)
++
++
++@RegisterMigration(13)
+ def user_add_wants_comment_notification(database):
+     """
+     Add wants_comment_notification to user model
+     """
+     add_table_field(database, 'users', 'wants_comment_notification', True)
Simple merge
Simple merge
Simple merge
Simple merge