Skip to content

Commit

Permalink
Strip secure hash to avoid copy-pasting issues with voucher
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Oct 8, 2024
1 parent 84ab975 commit ae0b22c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/voucher/voucher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def self.roles_for_lecture(lecture)
end

def self.find_voucher_by_hash(secure_hash)
Voucher.active.find_by(secure_hash: secure_hash)
# strip() to avoid issues with leading/trailing whitespaces when copy-pasting
Voucher.active.find_by(secure_hash: secure_hash.strip)
end

def invalidate!
Expand Down

0 comments on commit ae0b22c

Please sign in to comment.