aboutsummaryrefslogtreecommitdiff
path: root/master
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-31 17:49:14 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-31 17:49:14 +0530
commit886f49e6c836b8c2866fcd12c490a3feed981d76 (patch)
treea546ca7c65e7d090df9aa28a3d987e06af78cebd /master
parentUse + not __add__ for adding tuples. (diff)
downloadautotua-886f49e6c836b8c2866fcd12c490a3feed981d76.tar.gz
autotua-886f49e6c836b8c2866fcd12c490a3feed981d76.tar.bz2
autotua-886f49e6c836b8c2866fcd12c490a3feed981d76.zip
Model validation was removed for django 1.0
http://code.djangoproject.com/ticket/6845 http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#RemovedvalidatemethodsforModelandModelfieldclasses
Diffstat (limited to 'master')
-rw-r--r--master/autotua/process/__init__.py4
-rw-r--r--master/autotua/process/validate.py11
2 files changed, 6 insertions, 9 deletions
diff --git a/master/autotua/process/__init__.py b/master/autotua/process/__init__.py
index 13ec6d2..75d86b3 100644
--- a/master/autotua/process/__init__.py
+++ b/master/autotua/process/__init__.py
@@ -7,8 +7,6 @@
#
import random
-from django.core.validators import ValidationError
-import const, validate
from autotua import jobuild, sync
schemes = ['http', 'https', 'ftp']
@@ -33,7 +31,7 @@ def _get_arch_dir(arch):
for i in const.ARCHS:
if arch in const.ARCHS[i]:
return i
- raise ValidationError(const.VERRORS['invalid_arch'] % i)
+ raise Exception(const.VERRORS['invalid_arch'] % i)
def _get_deplist(atoms, rev):
"""
diff --git a/master/autotua/process/validate.py b/master/autotua/process/validate.py
index 9a84537..dcbc201 100644
--- a/master/autotua/process/validate.py
+++ b/master/autotua/process/validate.py
@@ -7,29 +7,28 @@
#
from datetime import datetime
-from django.core.validators import ValidationError
import const
def is_stage(stage):
if stage not in const.STAGES:
- raise ValidationError(const.VERRORS['invalid_stage'] % stage)
+ raise Exception(const.VERRORS['invalid_stage'] % stage)
return True
def is_arch(arch):
if arch not in const.ARCHS['all']:
- raise ValidationError(const.VERRORS['invalid_arch'] % i)
+ raise Exception(const.VERRORS['invalid_arch'] % i)
return True
def is_type(type):
if type not in const.STAGE_TYPE:
- raise ValidationError(const.VERRORS['invalid_type'] % type)
+ raise Exception(const.VERRORS['invalid_type'] % type)
return True
def is_release(release):
year, state = release.split('_', 1)
try:
if int(year.split('.', 1)[0]) > datetime.now().year:
- raise ValidationError(const.VERRORS['invalid_release'] % release)
+ raise Exception(const.VERRORS['invalid_release'] % release)
except:
- raise ValidationError(const.VERRORS['invalid_release'] % release)
+ raise Exception(const.VERRORS['invalid_release'] % release)
return True