allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [01/47] allura git commit: Remove unused method that would be insecure if used (no user_id check)
Date Tue, 27 Oct 2015 21:36:27 GMT
Repository: allura
Updated Branches:
  refs/heads/db/7919 64e060da4 -> d21d71d1c (forced update)


Remove unused method that would be insecure if used (no user_id check)


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/f33baf42
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f33baf42
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f33baf42

Branch: refs/heads/db/7919
Commit: f33baf423d9c7a11d76d1e860eb720bc2d792379
Parents: bae38ad
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Oct 19 18:53:51 2015 +0000
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Oct 19 18:53:51 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/oauth.py | 15 ---------------
 1 file changed, 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/f33baf42/Allura/allura/model/oauth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/oauth.py b/Allura/allura/model/oauth.py
index fb395f5..6dc00e5 100644
--- a/Allura/allura/model/oauth.py
+++ b/Allura/allura/model/oauth.py
@@ -20,11 +20,9 @@ import logging
 import oauth2 as oauth
 from pylons import tmpl_context as c, app_globals as g
 
-import pymongo
 from paste.deploy.converters import aslist
 from tg import config
 from ming import schema as S
-from ming.orm import session
 from ming.orm import FieldProperty, RelationProperty, ForeignIdProperty
 from ming.orm.declarative import MappedClass
 
@@ -72,19 +70,6 @@ class OAuthConsumerToken(OAuthToken):
 
     user = RelationProperty('User')
 
-    @classmethod
-    def upsert(cls, name):
-        t = cls.query.get(name=name)
-        if t is not None:
-            return t
-        try:
-            t = cls(name=name)
-            session(t).flush(t)
-        except pymongo.errors.DuplicateKeyError:
-            session(t).expunge(t)
-            t = cls.query.get(name=name)
-        return t
-
     @property
     def description_html(self):
         return g.markdown.cached_convert(self, 'description')


Mime
View raw message