Fix upgrade stdout handling if file doesn't exist yet
plus some other tweaks..
This commit is contained in:
parent
e5b0fe7198
commit
773a0c769d
|
@ -12,11 +12,13 @@
|
|||
location.href = '${cancel_url}';
|
||||
} else {
|
||||
|
||||
if (data.stdout) {
|
||||
var stdout = $('.stdout');
|
||||
var height = $(window).height() - stdout.offset().top - 50;
|
||||
stdout.height(height);
|
||||
stdout.append(data.stdout);
|
||||
stdout.animate({scrollTop: stdout.get(0).scrollHeight - height}, 250);
|
||||
}
|
||||
|
||||
if (data.complete || data.maximum) {
|
||||
$('#message').html(data.message);
|
||||
|
|
|
@ -895,6 +895,10 @@ class MasterView(View):
|
|||
progress.session['success_url'] = success_url
|
||||
progress.session.save()
|
||||
|
||||
def execute_error_message(self, error):
|
||||
return "Execution of {} failed: {}: {}".format(self.get_model_title(),
|
||||
type(error).__name__, error)
|
||||
|
||||
def get_execute_success_url(self, obj, **kwargs):
|
||||
return self.get_action_url('view', obj, **kwargs)
|
||||
|
||||
|
|
|
@ -298,6 +298,7 @@ class UpgradeView(MasterView):
|
|||
|
||||
path = self.rattail_config.upgrade_filepath(upgrade.uuid, filename='stdout.log')
|
||||
offset = session.get('stdout.offset', 0)
|
||||
if os.path.exists(path):
|
||||
size = os.path.getsize(path) - offset
|
||||
with open(path, 'rb') as f:
|
||||
f.seek(offset)
|
||||
|
|
Loading…
Reference in a new issue