Negate empty theme check

Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
This commit is contained in:
Karina Kwiatek 2023-11-03 23:32:52 +01:00
parent e95ae7b12e
commit 1c18b966db

View file

@ -22,7 +22,7 @@ class UserController < ApplicationController
def show_theme
theme = Theme.where(user: User.where("LOWER(screen_name) = ?", params[:username].downcase).select(:id)).first
return head :no_content if theme.nil?
return head :no_content unless theme
expires_in 3.months
return if fresh_when theme, public: true