
from sethji.model.sync import SyncAws
from sethji.views.account import requires_login
from flask import Blueprint, redirect, url_for, flash, request


mod = Blueprint('sync', __name__, url_prefix='/sync')


@mod.route("/", methods=["POST"])
@requires_login
def sync():
    sync_aws = SyncAws()
    sync_aws.background_sync()
    flash(u'AWS Sync Initiated')
    return redirect(request.path)


def is_sync_in_progress():
    sync_aws = SyncAws()
    return sync_aws.is_sync_in_progress()


from sethji.model.sync import SyncAws
from sethji.views.account import requires_login
from flask import Blueprint, redirect, url_for, flash


mod = Blueprint('sync', __name__, url_prefix='/sync')


@mod.route("/", methods=["POST"])
@requires_login
def sync():
    sync_aws = SyncAws()
    sync_aws.background_sync()
    flash(u'AWS Sync Initiated')
    return redirect(url_for('home'))


def is_sync_in_progress():
    sync_aws = SyncAws()
    return sync_aws.is_sync_in_progress()

Revert "Redirect to same page"
Revert "Redirect to same page"

This reverts commit 1f49ee31c21e1bebefb3be9ecc9e4df7c115a5ef.

  
  from sethji.model.sync import SyncAws
  from sethji.views.account import requires_login
- from flask import Blueprint, redirect, url_for, flash, request
+ from flask import Blueprint, redirect, url_for, flash
  
  
  mod = Blueprint('sync', __name__, url_prefix='/sync')
  
  
  @mod.route("/", methods=["POST"])
  @requires_login
  def sync():
      sync_aws = SyncAws()
      sync_aws.background_sync()
      flash(u'AWS Sync Initiated')
-     return redirect(request.path)
+     return redirect(url_for('home'))
  
  
  def is_sync_in_progress():
      sync_aws = SyncAws()
      return sync_aws.is_sync_in_progress()
  
Revert "Redirect to same page"
## Code Before:

from sethji.model.sync import SyncAws
from sethji.views.account import requires_login
from flask import Blueprint, redirect, url_for, flash, request


mod = Blueprint('sync', __name__, url_prefix='/sync')


@mod.route("/", methods=["POST"])
@requires_login
def sync():
    sync_aws = SyncAws()
    sync_aws.background_sync()
    flash(u'AWS Sync Initiated')
    return redirect(request.path)


def is_sync_in_progress():
    sync_aws = SyncAws()
    return sync_aws.is_sync_in_progress()

## Instruction:
Revert "Redirect to same page"
## Code After:

from sethji.model.sync import SyncAws
from sethji.views.account import requires_login
from flask import Blueprint, redirect, url_for, flash


mod = Blueprint('sync', __name__, url_prefix='/sync')


@mod.route("/", methods=["POST"])
@requires_login
def sync():
    sync_aws = SyncAws()
    sync_aws.background_sync()
    flash(u'AWS Sync Initiated')
    return redirect(url_for('home'))


def is_sync_in_progress():
    sync_aws = SyncAws()
    return sync_aws.is_sync_in_progress()
