daily pastebin goal
48%
SHARE
TWEET

Untitled

kira_111 Mar 1st, 2014 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   def removeAdmin(self, data):
  3.     for properties in data:
  4.       logging.error(properties)
  5.       if 'profile_key' not in properties:
  6.         logging.warning("Missing key in '%s'", properties)
  7.         continue
  8.       profile_key = properties['profile_key']
  9.      
  10.       if 'program_key' not in properties:
  11.         logging.warning("Missing key in '%s'", properties)
  12.         continue
  13.      
  14.       program_key = properties['program_key']
  15.       logging.error(program_key)
  16.       logging.error(type(program_key))
  17.       program_key_new = ndb.Key.from_old_key(program_key)
  18.      
  19.       profile = profile_key.get()
  20.       if not profile:
  21.           logging.warning("Invalid profile_key '%s'", profile_key)
  22.           return
  23.      
  24.       logging.error(profile_key)
  25.       @ndb.transactional
  26.       def remove_admin_txn():
  27.         #program_key_new=program_key
  28.         user = profile.key.parent()
  29.         #user=user_model.User.query(user_model.User.key.id() == profile.key.id()).get()
  30.  
  31.         if program_key_new in user.host_for:
  32.           user.host_for.remove(program_key_new)
  33.           user.put()     
  34.  
  35.       remove_admin_txn()
  36.  
  37.     return True
  38.  
  39. ERROR    2014-03-02 00:10:41,839 program.py:321] Key('GSoCProgram', 'google/gsoc2014')
  40. ERROR    2014-03-02 00:10:41,839 program.py:322] <type 'unicode'>
  41. ERROR    2014-03-02 00:10:41,839 gae_django.py:33] Exception in request:
  42. Traceback (most recent call last):
  43.   File "/home/kira111/shikher111-melange-soc/thirdparty/google_appengine/lib/django-1.5/django/core/handlers/base.py", line 115, in get_response
  44.     response = callback(request, *callback_args, **callback_kwargs)
  45.   File "/home/kira111/shikher111-melange-soc/build/soc/views/base.py", line 482, in __call__
  46.     return self._dispatch(data, check, mutator)
  47.   File "/home/kira111/shikher111-melange-soc/build/soc/views/base.py", line 439, in _dispatch
  48.     return self.post(data, check, mutator)
  49.   File "/home/kira111/shikher111-melange-soc/build/soc/modules/gsoc/views/program.py", line 392, in post
  50.     if ProgramAdminsList(data.request, data, links.SOC_LINKER, urls.UrlNames).post():
  51.   File "/home/kira111/shikher111-melange-soc/build/soc/modules/gsoc/views/program.py", line 303, in post
  52.     return self.removeAdmin(parsed)
  53.   File "/home/kira111/shikher111-melange-soc/build/soc/modules/gsoc/views/program.py", line 323, in removeAdmin
  54.     program_key_new = ndb.Key.from_old_key(program_key)
  55.   File "/home/kira111/shikher111-melange-soc/thirdparty/google_appengine/google/appengine/ext/ndb/key.py", line 583, in from_old_key
  56.     return cls(urlsafe=str(old_key))
  57.   File "/home/kira111/shikher111-melange-soc/thirdparty/google_appengine/google/appengine/ext/ndb/key.py", line 212, in __new__
  58.     self.__reference = _ConstructReference(cls, **kwargs)
  59.   File "/home/kira111/shikher111-melange-soc/thirdparty/google_appengine/google/appengine/ext/ndb/utils.py", line 136, in positional_wrapper
  60.     return wrapped(*args, **kwds)
  61.   File "/home/kira111/shikher111-melange-soc/thirdparty/google_appengine/google/appengine/ext/ndb/key.py", line 640, in _ConstructReference
  62.     serialized = _DecodeUrlSafe(urlsafe)
  63.   File "/home/kira111/shikher111-melange-soc/thirdparty/google_appengine/google/appengine/ext/ndb/key.py", line 790, in _DecodeUrlSafe
  64.     return base64.b64decode(urlsafe.replace('-', '+').replace('_', '/'))
  65.   File "/usr/lib/python2.7/base64.py", line 76, in b64decode
  66.     raise TypeError(msg)
  67. TypeError: Incorrect padding
  68. INFO     2014-03-02 00:10:41,880 recording.py:665] Saved; key: __appstats__:041700, part: 232 bytes, full: 30500 bytes, overhead: 0.001 + 0.008; link: http://localhost:9999/_ah/stats/details?time=1393719041798
  69. INFO     2014-03-02 00:10:41,885 module.py:617] default: "POST /gsoc/program/admins/google/gsoc2014 HTTP/1.1" 500 13440
  70. INFO     2014-03-02 00:10:42,185 recording.py:665] Saved; key: __appstats__:042100, part: 116 bytes, full: 10631 bytes, overhead: 0.000 + 0.009; link: http://localhost:9999/_ah/stats/details?time=1393719042153
  71. INFO     2014-03-02 00:10:42,194 module.py:617] default: "GET /_ah/warmup HTTP/1.1" 204 -
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top