mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Merge pull request #3320 from aignatov-bio/ai-sci-5718-remove-report-name-uniqness
Remove report name uniqueness [SCI-5718]
This commit is contained in:
commit
dde82423f1
|
@ -1057,13 +1057,11 @@ function reportHandsonTableConverter() {
|
|||
});
|
||||
|
||||
$('.reports-new').on('click', '#saveAsNewReport', function(e) {
|
||||
var params = getReportData();
|
||||
params.report.name = 'New ' + params.report.name;
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: this.dataset.createUrl,
|
||||
type: 'POST',
|
||||
data: JSON.stringify(params),
|
||||
data: JSON.stringify(getReportData()),
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
success: function() {},
|
||||
error: function(jqxhr) {
|
||||
|
|
|
@ -12,8 +12,7 @@ class Report < ApplicationRecord
|
|||
auto_strip_attributes :name, :description, nullify: false
|
||||
validates :name,
|
||||
length: { minimum: Constants::NAME_MIN_LENGTH,
|
||||
maximum: Constants::NAME_MAX_LENGTH },
|
||||
uniqueness: { scope: %i(user_id project_id), case_sensitive: false }
|
||||
maximum: Constants::NAME_MAX_LENGTH }
|
||||
validates :description, length: { maximum: Constants::TEXT_MAX_LENGTH }
|
||||
validates :project, presence: true
|
||||
validates :user, presence: true
|
||||
|
|
Loading…
Reference in a new issue