Added check to prevent students from submitting more proposals then allowed by the program settings.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
#!/usr/bin/env python## Copyright 2007 Google Inc.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.#from google.net.proto import ProtocolBufferimport arrayimport dummy_thread as thread__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit unusednames=printElemNumber,debug_strs no-special"""from google.appengine.api.api_base_pb import StringProtoclass UserServiceError(ProtocolBuffer.ProtocolMessage): OK = 0 REDIRECT_URL_TOO_LONG = 1 NOT_ALLOWED = 2 _ErrorCode_NAMES = { 0: "OK", 1: "REDIRECT_URL_TOO_LONG", 2: "NOT_ALLOWED", } def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, "") ErrorCode_Name = classmethod(ErrorCode_Name) def __init__(self, contents=None): pass if contents is not None: self.MergeFromString(contents) def MergeFrom(self, x): assert x is not self def Equals(self, x): if x is self: return 1 return 1 def IsInitialized(self, debug_strs=None): initialized = 1 return initialized def ByteSize(self): n = 0 return n + 0 def Clear(self): pass def OutputUnchecked(self, out): pass def TryMerge(self, d): while d.avail() > 0: tt = d.getVarInt32() if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError d.skipData(tt) def __str__(self, prefix="", printElemNumber=0): res="" return res _TEXT = ( "ErrorCode", ) _TYPES = ( ProtocolBuffer.Encoder.NUMERIC, ) _STYLE = """""" _STYLE_CONTENT_TYPE = """"""__all__ = ['UserServiceError']