Exemplo n.º 1
0
    def clean(self):
        super(DepartmentPage, self).clean()
        req = current_request()
        try:
            if str(self.department_name) == req.user.userdepartment.department or req.user.userdepartment.department == 'All':
                return self
            else:
                raise ValidationError(
                "You don't have access to change this Database")

        except:
            raise ValidationError(
            "You don't have access to change this Database")
Exemplo n.º 2
0
    def clean(self):
        super(TimeTable, self).clean()
        req = current_request()
        try:
            logged_user = req.user.userdepartment
            if (str(self.department) == logged_user.department) or logged_user.department == 'All':
                return self
            else:
                raise ValidationError(
                "You don't have access to change this Database")

        except:
            raise ValidationError(
            "You don't have access to change this Database")