Skip to content

Commit

Permalink
FIX: Group name with capital letter throws 404 error (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedgagan committed Jul 10, 2020
1 parent 48cda7b commit 43759bd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
@@ -1,4 +1,3 @@
{{log model}}
<section class="user-secondary-navigation">
{{#mobile-nav class="activity-nav" desktopClass="action-list activity-list nav-stacked" currentPath=router._router.currentPath}}
{{#load-more selector=".activity-nav li" action=(action "loadMore")}}
Expand Down
2 changes: 1 addition & 1 deletion plugin.rb
Expand Up @@ -250,7 +250,7 @@ class ::ListController
add_to_class(:list_controller, :group_topics_assigned) do
page = (params[:page].to_i || 0).to_i

group = Group.find_by("LOWER(name) = ?", params[:groupname])
group = Group.find_by("name = ?", params[:groupname])
raise Discourse::NotFound unless group
raise Discourse::InvalidAccess unless current_user.can_assign?

Expand Down

2 comments on commit 43759bd

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Régis Hanol posted:

I don’t think group names are case sensitive. We should probably call LOWER on the SQL side and .downcase on the Ruby side ;)

@tgxworld
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a spec for this fix?

Please sign in to comment.