catalogApp.py
def editCategory(category_id):
    '''
    Makes changes to an existing category in the database.
    '''
    editedCategory = session.query(Category).filter_by(id=category_id).one()
    if editedCategory.user_id != login_session['user_id']:
        flash("You cannot edit this category. Catergories can only be \
              modified by their owners. Create a category of your own to \
              modify.")
        return redirect(url_for('showCategories'))
    if request.method == 'POST':
        if request.form['name']:
            editedCategory.name = request.form['name']
        if request.form['img_url']:
            editedCategory.img_url = request.form['img_url']
        session.add(editedCategory)
        session.commit()
        flash("You have made changes to a category.")
        return redirect(url_for('showCategories'))
    else:
        return render_template('editcategory.html', category=editedCategory,
                               login_session=login_session)

    Makes changes to an existing category in the database.
    
Makes changes to an existing category in the database.
Makes changes to an existing category in the database .
def editCategory(category_id):
    editedCategory = session.query(Category).filter_by(id=category_id).one()
    if editedCategory.user_id != login_session['user_id']:
        flash("You cannot edit this category. Catergories can only be \
              modified by their owners. Create a category of your own to \
              modify.")
        return redirect(url_for('showCategories'))
    if request.method == 'POST':
        if request.form['name']:
            editedCategory.name = request.form['name']
        if request.form['img_url']:
            editedCategory.img_url = request.form['img_url']
        session.add(editedCategory)
        session.commit()
        flash("You have made changes to a category.")
        return redirect(url_for('showCategories'))
    else:
        return render_template('editcategory.html', category=editedCategory,
                               login_session=login_session)
def editCategory ( category_id ) : editedCategory = session . query ( Category ) . filter_by ( id = category_id ) . one ( ) if editedCategory . user_id != login_session [ 'user_id' ] : flash ( "You cannot edit this category. Catergories can only be \
              modified by their owners. Create a category of your own to \
              modify." ) return redirect ( url_for ( 'showCategories' ) ) if request . method == 'POST' : if request . form [ 'name' ] : editedCategory . name = request . form [ 'name' ] if request . form [ 'img_url' ] : editedCategory . img_url = request . form [ 'img_url' ] session . add ( editedCategory ) session . commit ( ) flash ( "You have made changes to a category." ) return redirect ( url_for ( 'showCategories' ) ) else : return render_template ( 'editcategory.html' , category = editedCategory , login_session = login_session )
Makes changes to an existing category in the database.
Makes changes to an existing category in the database .
'''
    Makes changes to an existing category in the database.
    '''
category_id