diff --git a/backend/copr_backend/helpers.py b/backend/copr_backend/helpers.py index f74f2aa4d..05348366d 100644 --- a/backend/copr_backend/helpers.py +++ b/backend/copr_backend/helpers.py @@ -634,11 +634,12 @@ def get_chroot_arch(chroot): def format_evr(epoch, version, release): """ - Return evr in format (epoch:)version-release + Return evr in format (epoch:)version-release. The argument 'epoch' should + be integer value or null (but we rather also consider "strings" values). """ - if epoch is not None and epoch.isdigit(): - return f"{epoch}:{version}-{release}" - + if epoch is not None: + if isinstance(epoch, int) or epoch.isdigit(): + return f"{epoch}:{version}-{release}" return f"{version}-{release}"