Skip to content

Commit 0370748

Browse files
committed
Trimed performer name to help with iOS devices adding spaces
Not a perfect fix
1 parent 92079da commit 0370748

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

website/karakara/views/queue.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ def queue_add(request):
145145
# If not admin, check additional restrictions
146146
if not is_admin(request):
147147

148+
performer_name = request.params.get('performer_name').strip() # TODO: It would be good to ensure this value is writen to the db. However we cant modify the request.param dict directly. See creation of queueitem below
149+
148150
# Valid performer name
149151
valid_performer_names = request.registry.settings.get('karakara.queue.add.valid_performer_names')
150-
if valid_performer_names and request.params.get('performer_name').lower() not in map(lambda name: name.lower(), valid_performer_names):
152+
if valid_performer_names and performer_name.lower() not in map(lambda name: name.lower(), valid_performer_names):
151153
message = _('view.queue.add.invalid_performer_name ${performer_name}', mapping=dict(
152-
performer_name=request.params.get('performer_name')
154+
performer_name=performer_name
153155
))
154156
raise action_error(message, code=400)
155157

@@ -161,7 +163,7 @@ def queue_add(request):
161163
except Exception:
162164
latest_track_title = ''
163165
message = _('view.queue.add.dupicate_performer_limit ${performer_name} ${estimated_next_add_time} ${track_count} ${latest_queue_item_title}', mapping=dict(
164-
performer_name=request.params.get('performer_name'),
166+
performer_name=performer_name,
165167
latest_queue_item_title=latest_track_title,
166168
**subdict(queue_item_performed_tracks, {
167169
'estimated_next_add_time',

0 commit comments

Comments
 (0)