Ejemplo n.º 1
0
 def clean(self):
     is_sdk_2 = self.sdk_version == "2"
     if is_sdk_2 and self.uses_array_message_keys:
         raise ValidationError(
             _("SDK2 appKeys must be an object, not a list."))
     if self.project_type != 'package':
         try:
             parse_sdk_version(self.app_version_label)
         except ValueError:
             raise ValidationError(
                 _("Invalid version string. Versions should be major[.minor]."
                   ))
     if self.project_type == 'package':
         try:
             parse_semver(self.app_version_label)
         except ValueError:
             raise ValidationError(
                 _("Invalid version string. Versions should be major.minor.patch"
                   ))
         if is_sdk_2:
             raise ValidationError(
                 _("Packages are not available for SDK 2"))
         if not self.app_modern_multi_js:
             raise ValidationError(
                 _("Packages must use CommonJS-style JS Handling."))
     elif self.project_type == 'rocky':
         if is_sdk_2:
             raise ValidationError(_("RockyJS is not available for SDK 2"))
         if not self.uses_array_message_keys:
             raise ValidationError(
                 _("RockyJS projects must use array based appmessage keys"))
         if not self.app_modern_multi_js:
             raise ValidationError(
                 _("RockyJS projects must use CommonJS-style JS Handling."))
Ejemplo n.º 2
0
 def clean(self):
     is_sdk_2 = self.sdk_version == "2"
     if is_sdk_2 and self.uses_array_message_keys:
         raise ValidationError(_("SDK2 appKeys must be an object, not a list."))
     if self.project_type != 'package':
         try:
             parse_sdk_version(self.app_version_label)
         except ValueError:
             raise ValidationError(_("Invalid version string. Versions should be major[.minor]."))
     if self.project_type == 'package':
         try:
             parse_semver(self.app_version_label)
         except ValueError:
             raise ValidationError(_("Invalid version string. Versions should be major.minor.patch"))
         if is_sdk_2:
             raise ValidationError(_("Packages are not available for SDK 2"))
         if not self.app_modern_multi_js:
             raise ValidationError(_("Packages must use CommonJS-style JS Handling."))
     elif self.project_type == 'rocky':
         if is_sdk_2:
             raise ValidationError(_("RockyJS is not available for SDK 2"))
         if not self.uses_array_message_keys:
             raise ValidationError(_("RockyJS projects must use array based appmessage keys"))
         if not self.app_modern_multi_js:
             raise ValidationError(_("RockyJS projects must use CommonJS-style JS Handling."))
Ejemplo n.º 3
0
def version_validator(value):
    try:
        parse_sdk_version(value)
    except ValueError:
        raise ValidationError(
            _("Invalid version string. Versions should be major[.minor]."))
Ejemplo n.º 4
0
def version_validator(value):
    try:
        parse_sdk_version(value)
    except ValueError:
        raise ValidationError(_("Invalid version string. Versions should be major[.minor]."))