Skip to content

Commit

Permalink
fix: Populate room selection in pay categories
Browse files Browse the repository at this point in the history
  • Loading branch information
noahpistilli committed Aug 24, 2024
1 parent d92b7a7 commit 4ffaeed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions theunderground/pay_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from models import PayCategories, db, PayCategoryHeaders
from room import app
from theunderground.forms import CategoryForm, PayCategoryHeaderForm
from theunderground.mobiclip import get_room_list
from theunderground.operations import manage_delete_item
from theunderground.admin import oidc

Expand All @@ -33,6 +34,7 @@ def list_pay_categories():
@oidc.require_login
def add_pay_category():
form = CategoryForm()
form.room.choices = get_room_list()
# As we're adding, ensure a file is required.
form.thumbnail.flags.required = True

Expand All @@ -57,6 +59,7 @@ def add_pay_category():
def edit_pay_category(category):
form = CategoryForm()
form.submit.label.text = "Edit"
form.room.choices = get_room_list()

# Populate data
current_category = PayCategories.query.filter(
Expand Down

0 comments on commit 4ffaeed

Please sign in to comment.