Skip to content
Permalink
Browse files

Fix the daily number of votes

The daily number of votes is computed every day, via a crontab. It
updates the accounts, and the account model needs to be valid for the
change to be applied. But, there was a validator on the length of
uploaded_stylesheet, and when a user has uploaded a stylesheet, the
uplodaded_stylesheet field was a mounter uploaded instance, not a
string, and its length was larger than the allower 255 characters. As
the uploaded_stylesheet in database is generated by the uploader (code
on the server), and not controlled from client side, we can safely
remove the validation on the length, and it should fix the issue.
  • Loading branch information...
nono committed Sep 22, 2019
1 parent 12539b1 commit 47416af88e930176bd953abdcebe75f9c29ae3e1
Showing with 0 additions and 1 deletion.
  1. +0 −1 app/models/account.rb
@@ -80,7 +80,6 @@ class Account < ActiveRecord::Base
confirmation: { message: "La confirmation du mot de passe ne correspond pas au mot de passe" }

validates :stylesheet, length: { maximum: 255, message: "L'URL de la feuille de style est trop longue" }
validates :uploaded_stylesheet, length: { maximum: 255, message: "L'URL de la feuille de style est trop longue" }

### Authentication ###

0 comments on commit 47416af

Please sign in to comment.
You can’t perform that action at this time.