edit comments
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import config
|
||||
from flask import Blueprint, render_template, request, redirect, url_for, jsonify
|
||||
from flask_login import login_required
|
||||
|
||||
import config
|
||||
from model.State import State
|
||||
from model.Block import Block
|
||||
from model.Utilities import HtmlHelper
|
||||
|
||||
@@ -6,11 +6,10 @@ from model.State import State
|
||||
|
||||
district_bp = Blueprint('district', __name__)
|
||||
|
||||
|
||||
# ------- District page --------
|
||||
@district_bp.route('/add_district', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def add_district():
|
||||
|
||||
district = District()
|
||||
|
||||
if request.method == 'POST':
|
||||
@@ -28,7 +27,7 @@ def add_district():
|
||||
states=states
|
||||
)
|
||||
|
||||
|
||||
# ------- District check --------
|
||||
@district_bp.route('/check_district', methods=['POST'])
|
||||
@login_required
|
||||
def check_district():
|
||||
@@ -37,7 +36,7 @@ def check_district():
|
||||
|
||||
return district.CheckDistrict(request=request)
|
||||
|
||||
|
||||
# ------- District delete by district id --------
|
||||
@district_bp.route('/delete_district/<int:district_id>')
|
||||
@login_required
|
||||
def delete_district(district_id):
|
||||
@@ -52,6 +51,7 @@ def delete_district(district_id):
|
||||
return redirect(url_for('district.add_district'))
|
||||
|
||||
|
||||
# ------- District update by district id --------
|
||||
@district_bp.route('/edit_district/<int:district_id>', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def edit_district(district_id):
|
||||
|
||||
@@ -4,7 +4,7 @@ from model.State import State
|
||||
|
||||
state_bp = Blueprint('state', __name__)
|
||||
|
||||
|
||||
# ----- State page ------
|
||||
@state_bp.route('/add_state', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def add_state():
|
||||
@@ -19,7 +19,7 @@ def add_state():
|
||||
|
||||
return render_template('add_state.html', statedata=statedata)
|
||||
|
||||
|
||||
# ----- State check ------
|
||||
@state_bp.route('/check_state', methods=['POST'])
|
||||
@login_required
|
||||
def check_state():
|
||||
@@ -28,21 +28,21 @@ def check_state():
|
||||
|
||||
return state.CheckState(request=request)
|
||||
|
||||
|
||||
# ----- State delete by state id ------
|
||||
@state_bp.route('/delete_state/<int:id>')
|
||||
@login_required
|
||||
def deleteState(id):
|
||||
|
||||
state = State()
|
||||
|
||||
msg = state.DeleteState(request=request, id=id)
|
||||
state.DeleteState(request=request, id=id)
|
||||
|
||||
if not state.isSuccess:
|
||||
return state.resultMessage
|
||||
else:
|
||||
return redirect(url_for('state.add_state'))
|
||||
|
||||
|
||||
# ----- State update by state id ------
|
||||
@state_bp.route('/edit_state/<int:id>', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def editState(id):
|
||||
|
||||
Reference in New Issue
Block a user