Exemplo n.º 1
0
    def update_hybrid_view(self, request):
        updates = update.hybrid()

        if any(map(operator.attrgetter('errors'), updates)):
            message = _('There was some errors when computing the hybrid table, please check the error report')
        else:
            message = _('Hybrid table build successfully')

        request.user.message_set.create(message=message)
        return HttpResponseRedirect(request.path + "../")
Exemplo n.º 2
0
    def handle_noargs(self, *args, **options):
        print 'Building hybrid tables from patches and original devices...'
        try:
            updates = update.hybrid()

            for u in updates:
                print '-- %s Update --' % u.get_update_type_display()
                print u.summary
        except Exception, e:
            if options.get('traceback', False):
                import traceback
                traceback.print_exc()
            else:
                raise CommandError(e)
Exemplo n.º 3
0
    def update_hybrid_view(self, request):

        if not self.has_add_permission(request):
            raise PermissionDenied

        updates = update.hybrid()

        if any(map(operator.attrgetter('errors'), updates)):
            message_bit = _('There was some errors when computing the hybrid table, please check the error report')
        else:
            message_bit = _('Hybrid table build successfully')

        self.message_user(request, "%s" % message_bit)
        return HttpResponseRedirect(reverse('admin:wurfl_update_changelist'))