Skip to content

Commit

Permalink
Town6: Field Display
Browse files Browse the repository at this point in the history
Remove field if there are no TicketPermissions

TYPE: Bugfix
LINK: OGC-1766
  • Loading branch information
BreathingFlesh authored Sep 5, 2024
1 parent 47768a5 commit 4d97fe7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/onegov/org/forms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,12 @@ def on_request(self) -> None:
)
for p in self.request.session.query(TicketPermission)
), key=lambda x: x[1])
self.permissions.choices = permissions
self.permissions.default = [p[0] for p in permissions]

if not permissions:
self.delete_field('permissions')
else:
self.permissions.choices = permissions
self.permissions.default = [p[0] for p in permissions]

user_q = self.request.session.query(User).filter_by(role='admin')
user_q = user_q.order_by(User.created.desc())
Expand Down

0 comments on commit 4d97fe7

Please sign in to comment.