jet-admin / jet-bridge

Implicit enumerate calls found PTC-W0060
Anti-pattern
Major
6 months ago3 years old
Consider replacing range(len(forbidden)) with enumerate(forbidden)
 74
 75    def validate(self, attrs):
 76        forbidden = ['insert', 'update', 'delete', 'grant', 'show']
 77        for i in range(len(forbidden)): 78            forbidden.append('({}'.format(forbidden[i]))
 79        if any(map(lambda x: ' {} '.format(attrs['query'].lower()).find(' {} '.format(x)) != -1, forbidden)):
 80            raise ValidationError({'query': 'forbidden query'})