Skip to content

Commit

Permalink
fix: release date past check updated
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Jan 19, 2024
1 parent 7908ea2 commit c2c68be
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/PublishReleasedProjects.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function handle(PublishProject $publisher)
])->get();
foreach ($projects as $project) {
$release_date = Carbon::parse($project->release_date);
if ($release_date->isToday()) {
if ($release_date->isPast()) {
$publisher->publish($project);
Notification::send($project->owner, new DraftProcessedNotification($project));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function publish(Request $request, Project $project, PublishProject $publ
$release_date = $input['release_date'];
if (! $project->is_public && ! is_null($project->doi) && ! is_null($release_date)) {
$release_date = Carbon::parse($release_date);
if ($release_date->isToday()) {
if ($release_date->isPast()) {
$updater->update($project, $request->all());
$publisher->publish($project);
$project->sendNotification('publish', $this->prepareSendList($project));
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/ProcessProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function handle(AssignIdentifier $assigner, PublishProject $publisher)

$release_date = Carbon::parse($project->release_date);

if ($release_date->isToday()) {
if ($release_date->isPast()) {
$publisher->publish($project);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Jobs/ProcessSubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function handle(AssignIdentifier $assigner, PublishProject $projectPublis

$release_date = Carbon::parse($project->release_date);

if ($release_date->isToday()) {
if ($release_date->isPast()) {
$projectPublisher->publish($project);
}

Expand Down Expand Up @@ -168,7 +168,7 @@ public function handle(AssignIdentifier $assigner, PublishProject $projectPublis
$assigner->assign($_studies);
$release_date = Carbon::parse($project->release_date);

if ($release_date->isToday()) {
if ($release_date->isPast()) {
foreach ($_studies as $study) {
$studyPublisher->publish($study);
}
Expand Down

0 comments on commit c2c68be

Please sign in to comment.