diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-03 03:08:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-03 03:08:25 +0300 |
commit | d489dd79cfc33b730022b3c91c29fb8a5583b4b1 (patch) | |
tree | 4a0d6acf932a64b605f6a021b9b6c952874f83ef /app/models/packages | |
parent | b6a26580610bc6e0ba577260744bc3b52f1ffb46 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/packages')
-rw-r--r-- | app/models/packages/package_file.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/packages/package_file.rb b/app/models/packages/package_file.rb index b49e04f481c..3d56c563ec8 100644 --- a/app/models/packages/package_file.rb +++ b/app/models/packages/package_file.rb @@ -35,6 +35,7 @@ class Packages::PackageFile < ApplicationRecord validates :file_name, presence: true validates :file_name, uniqueness: { scope: :package }, if: -> { !pending_destruction? && package&.pypi? } + validates :file_sha256, format: { with: Gitlab::Regex.sha256_regex }, if: -> { package&.pypi? }, allow_nil: true scope :recent, -> { order(id: :desc) } scope :limit_recent, ->(limit) { recent.limit(limit) } |