1. PyPA
  2. Python Packaging Authority Projects
  3. pypi


Donald Stufft  committed fdf4149

Remove the case sensitivity paramter as looksups are now always case insensitive

  • Participants
  • Parent commits 40c5554
  • Branches user-account-parity

Comments (0)

Files changed (2)

File store.py

View file
     # Users interface
-    def has_user(self, name, case_sensitive=True):
+    def has_user(self, name):
         ''' Determine whether the user exists in the database.
             Returns true/false.
                 return otkv
     _User = FastResultRow('name password email gpg_keyid last_login!')
-    def get_user(self, name, case_sensitive=True):
+    def get_user(self, name):
         ''' Retrieve info about the user from the database.
             Returns a mapping with the user info or None if there is no

File webui.py

View file
         # Fetch the user from the database
-        user = self.store.get_user(un, case_sensitive=False)
+        user = self.store.get_user(un)
         # Verify the hash, and see if it needs migrated
         ok, new_hash = self.config.passlib.verify_and_update(pw, user["password"])
             name = info['name']
             if not safe_username.match(name):
                 raise FormError, 'Username is invalid (ASCII alphanum,.,_ only)'
-            if self.store.has_user(name, case_sensitive=False):
+            if self.store.has_user(name):
                 self.fail('user "%s" already exists' % name,
                     heading='User registration')
                 title="Request password reset", retry=True)
-        user = self.store.get_user(name, case_sensitive=False)
+        user = self.store.get_user(name)
         # typically other systems would not indicate the username is invalid
         # but in PyPI's case the username list is public so this is more
         # user-friendly with no security penalty
         username = username.replace(' ','.')
         username = re.sub('[^a-zA-Z0-9._]','',username)
         error = 'Please choose a username to complete registration'
-        if self.store.has_user(username, case_sensitive=False):
+        if self.store.has_user(username):
             suffix = 2
             while self.store.has_user("%s_%d" % (username, suffix)):
                 suffix += 1