pymensago/keycard.py
def is_data_compliant(self) -> RetVal:
		'''Performs basic compliancy checks for the data fields only'''

		if self.type not in [ 'User', 'Organization']:
			return RetVal(UnsupportedKeycardType, f"unsupported card type {self.type}")
		
		# Check for existence of required fields
		for field in self.required_fields:
			if field not in self.fields or not self.fields[field]:
				return RetVal(RequiredFieldMissing, f"missing field {field}")
		
			if field != field.strip():
				return RetVal(ErrBadData, f"leading/trailing whitespace in field {field}")
		
		if self.type == 'User':
			return self.__validate_user_data()
			
		return self.__validate_org_data()
Performs basic compliancy checks for the data fields only
Performs basic compliancy checks for the data fields only
Performs basic compliancy checks for the data fields only
def is_data_compliant(self) -> RetVal:
		if self.type not in [ 'User', 'Organization']:
			return RetVal(UnsupportedKeycardType, f"unsupported card type {self.type}")
		for field in self.required_fields:
			if field not in self.fields or not self.fields[field]:
				return RetVal(RequiredFieldMissing, f"missing field {field}")
			if field != field.strip():
				return RetVal(ErrBadData, f"leading/trailing whitespace in field {field}")
		if self.type == 'User':
			return self.__validate_user_data()
		return self.__validate_org_data()
def is_data_compliant ( self ) -> RetVal : if self . type not in [ 'User' , 'Organization' ] : return RetVal ( UnsupportedKeycardType , f"unsupported card type {self.type}" ) for field in self . required_fields : if field not in self . fields or not self . fields [ field ] : return RetVal ( RequiredFieldMissing , f"missing field {field}" ) if field != field . strip ( ) : return RetVal ( ErrBadData , f"leading/trailing whitespace in field {field}" ) if self . type == 'User' : return self . __validate_user_data ( ) return self . __validate_org_data ( )
Performs basic compliancy checks for the data fields only
Performs basic compliancy checks for the data fields only
'''Performs basic compliancy checks for the data fields only''' # Check for existence of required fields
self