about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-01-23 21:40:03 +0100
committermultiple creatures <dev@multiple-creature.party>2020-02-21 03:32:42 -0600
commite6bb4bd747a0120dd0207aecbb7c5c67b7caa165 (patch)
tree8685b5ce824c9d348620cdf6c6acc33875f9b3c8 /app
parentc8159e7ccbb0d34e4698d0d7a6312ab439e0ca5f (diff)
port tootsuite#12562 to monsterfork: Fix media attachments without file being uploadable
Fix #12554
Diffstat (limited to 'app')
-rw-r--r--app/models/media_attachment.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb
index d2db899ab..f8e925942 100644
--- a/app/models/media_attachment.rb
+++ b/app/models/media_attachment.rb
@@ -121,7 +121,8 @@ class MediaAttachment < ApplicationRecord
   include Attachmentable
 
   validates :account, presence: true
-  validates :description, length: { maximum: 6666 }, if: :local?
+  validates :description, length: { maximum: MAX_DESCRIPTION_LENGTH }, if: :local?
+  validates :file, presence: true, if: :local?
 
   scope :attached,   -> { where.not(status_id: nil).or(where.not(scheduled_status_id: nil)) }
   scope :unattached, -> { where(status_id: nil, scheduled_status_id: nil) }