pythondotorg icon indicating copy to clipboard operation
pythondotorg copied to clipboard

Enhancement: Sanitize release names to require string

Open JacobCoffee opened this issue 7 months ago • 0 comments

Is your feature request related to a problem? Please describe.

When creating a new release to test #2717, I thought the PR was bad because it was possible to create a release named just 3.20, causing the downloads/windows/ page to crash because it lacked a None check in the PR for release version.

Describe the solution you'd like

It'd be nice to just give a little error message in the admin form submission via:

def clean(self):
  super().clean()
  if not re.match(r'^Python\s[\d.]+$', self.name):
      raise ValidationError({
          'name': 'Name must be in the format "Python X.Y.Z" (e.g., "Python 3.9.0")'
      })

to get: Image

Basic Example

No response

Describe alternatives you've considered

No response

Drawbacks and Impact

No response

Additional context

No response

JacobCoffee avatar May 06 '25 15:05 JacobCoffee