Mongo removal: Remove the validate=True arg to obj.save()
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 23 Dec 2012 20:01:13 +0000 (21:01 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 23 Dec 2012 23:07:24 +0000 (00:07 +0100)
all callers were forced to use validate=True anyway. So
remove this useless stuff.

mediagoblin/auth/views.py
mediagoblin/db/sql/base.py
mediagoblin/gmg_commands/users.py
mediagoblin/plugins/api/views.py
mediagoblin/submit/views.py
mediagoblin/user_pages/views.py

index 7e1ad440ae0e8f1653ba35e1417d83993cae7524..efd3e018a25243c8a497b9d3a9457e82c75a9a9a 100644 (file)
@@ -82,7 +82,7 @@ def register(request):
             user.pw_hash = auth_lib.bcrypt_gen_password_hash(
                 request.form['password'])
             user.verification_key = unicode(uuid.uuid4())
-            user.save(validate=True)
+            user.save()
 
             # log the user in
             request.session['user_id'] = unicode(user.id)
index fbbac6f919c750d5e387cc59494830cbd6e6ebab..2dceca75a5ce49bdb77a7f7117534f40d75d7969 100644 (file)
@@ -61,8 +61,7 @@ class GMGTableBase(object):
         # The key *has* to exist on sql.
         return getattr(self, key)
 
-    def save(self, validate=True):
-        assert validate
+    def save(self):
         sess = object_session(self)
         if sess is None:
             sess = Session()
index 70e591c92203ae52efe03935d87e32910cb4e73c..024c8498c635ac9708a6d85f4a6b9eaead49c865 100644 (file)
@@ -55,7 +55,7 @@ def adduser(args):
         entry.pw_hash = auth_lib.bcrypt_gen_password_hash(args.password)
         entry.status = u'active'
         entry.email_verified = True
-        entry.save(validate=True)
+        entry.save()
 
         print "User created (and email marked as verified)"
 
index 3d9437e043be566845d4708836ba03051e3fda0b..4c36d1103a5a1f5c801e482d05114f47054f5fe2 100644 (file)
@@ -94,7 +94,7 @@ def post_entry(request):
     entry.queued_task_id = task_id
 
     # Save now so we have this data before kicking off processing
-    entry.save(validate=True)
+    entry.save()
 
     if request.form.get('callback_url'):
         metadata = request.db.ProcessingMetaData()
index 3628fa0da679fcb49ef5194ce2ee7ca58c4f41d3..1f0e927e4ea3c255ee4c3e69090d49b7ec74483a 100644 (file)
@@ -112,7 +112,7 @@ def submit_start(request):
                 entry.queued_task_id = task_id
 
                 # Save now so we have this data before kicking off processing
-                entry.save(validate=True)
+                entry.save()
 
                 # Pass off to processing
                 #
@@ -210,7 +210,7 @@ def add_collection(request, media=None):
                 messages.add_message(
                     request, messages.ERROR, _('You already have a collection called "%s"!' % collection.title))
             else:
-                collection.save(validate=True)
+                collection.save()
 
                 add_message(request, SUCCESS, _('Collection "%s" added!' % collection.title))
 
index 33828c1bdbcb10ce300c15b01a57345c4498d805..28ef90d6b1c702fcd2239eaaf19ce095d4b27fdb 100644 (file)
@@ -215,7 +215,7 @@ def media_collect(request, media):
         collection.description = request.form.get('collection_description')
         collection.creator = request.user.id
         collection.generate_slug()
-        collection.save(validate=True)
+        collection.save()
 
     # Otherwise, use the collection selected from the drop-down
     else:
@@ -241,10 +241,10 @@ def media_collect(request, media):
         collection_item.media_entry = media.id
         collection_item.author = request.user.id
         collection_item.note = request.form['note']
-        collection_item.save(validate=True)
+        collection_item.save()
 
         collection.items = collection.items + 1
-        collection.save(validate=True)
+        collection.save()
 
         media.collected = media.collected + 1
         media.save()