Skip to content

Commit

Permalink
Merge pull request #525 from robertatakenaka/verifica_migration
Browse files Browse the repository at this point in the history
Corrige o processo de migração após as atualização de convergência dos fluxos de migração e upload
  • Loading branch information
robertatakenaka authored Aug 23, 2024
2 parents 6f21759 + d177e60 commit c2fb766
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 19 deletions.
23 changes: 14 additions & 9 deletions article/button_helper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.utils.translation import gettext as _
from wagtail.contrib.modeladmin.helpers import ButtonHelper

from upload.choices import PC_ERRATUM, PC_UPDATE
# FIXME
# from upload.choices import PC_ERRATUM, PC_UPDATE

from .choices import AS_REQUIRE_ERRATUM, AS_REQUIRE_UPDATE

Expand All @@ -22,10 +23,12 @@ def see_instructions(self, obj, classnames):
def submit_change(self, obj, classnames):
text = _("Submit change")

if obj.article.status == AS_REQUIRE_UPDATE:
package_category = PC_UPDATE
elif obj.article.status == AS_REQUIRE_ERRATUM:
package_category = PC_ERRATUM
package_category = ""
# FIXME
# if obj.article.status == AS_REQUIRE_UPDATE:
# package_category = PC_UPDATE
# elif obj.article.status == AS_REQUIRE_ERRATUM:
# package_category = PC_ERRATUM

return {
"url": "/admin/upload/package/create/?article_id=%s&package_category=%s"
Expand Down Expand Up @@ -83,10 +86,12 @@ def request_change(self, obj, classnames):
def submit_change(self, obj, classnames):
text = _("Submit change")

if obj.status == AS_REQUIRE_UPDATE:
package_category = PC_UPDATE
elif obj.status == AS_REQUIRE_ERRATUM:
package_category = PC_ERRATUM
package_category = ""
# FIXME
# if obj.article.status == AS_REQUIRE_UPDATE:
# package_category = PC_UPDATE
# elif obj.article.status == AS_REQUIRE_ERRATUM:
# package_category = PC_ERRATUM

return {
"url": "/admin/upload/package/create/?article_id=%s&package_category=%s"
Expand Down
18 changes: 13 additions & 5 deletions publication/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
from publication.api.pressrelease import publish_pressrelease
from publication.api.publication import PublicationAPI
from tracker.models import UnexpectedEvent
from upload.models import Package

# FIXME
# from upload.models import Package

User = get_user_model()

Expand Down Expand Up @@ -342,10 +344,16 @@ def task_publish_article(
try:
user = _get_user(user_id, username)
manager = None
if upload_package_id:
manager = Package.objects.get(pk=upload_package_id)
elif article_proc_id:
manager = ArticleProc.objects.get(pk=article_proc_id)

try:
if upload_package_id:
manager = Package.objects.get(pk=upload_package_id)
elif article_proc_id:
manager = ArticleProc.objects.get(pk=article_proc_id)

except Exception as e:
logging.exception(e)
return

article = manager.article

Expand Down
13 changes: 8 additions & 5 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ minio==7.2.5
# Upload
# ------------------------------------------------------------------------------
lxml==4.9.4 # https://github.com/lxml/lxml
-e git+https://github.com/scieloorg/[email protected]#egg=packtools
# packtools dependence
langdetect==1.0.9
#-e git+https://github.com/scieloorg/packtools.git@master#egg=packtools
-e git+https://github.com/scieloorg/[email protected]#egg=packtools
-e git+https://github.com/scieloorg/scielo_scholarly_data#egg=scielo_scholarly_data

# DSM Publication
Expand All @@ -69,8 +72,7 @@ mongoengine==0.28.2
aiohttp==3.9.1
# DSM Migration
# ------------------------------------------------------------------------------
-e git+https://github.com/scieloorg/[email protected]#egg=scielo_classic_website
#-e git+https://github.com/scieloorg/scielo_migration.git#egg=scielo_classic_website
-e git+https://github.com/scieloorg/[email protected]#egg=scielo_classic_website
python-dateutil==2.8.2
tornado>=6.3.2 # not directly required, pinned by Snyk to avoid a vulnerability

Expand All @@ -79,8 +81,9 @@ tornado>=6.3.2 # not directly required, pinned by Snyk to avoid a vulnerability
tenacity==8.2.3 # https://pypi.org/project/tenacity/
urllib3==2.2.2

# feedparser
# iso639-langs
# ------------------------------------------------------------------------------
iso639-lang==2.2.3
feedparser==6.0.11
requests>=2.32.2 # not directly required, pinned by Snyk to avoid a vulnerability
certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability
certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability

0 comments on commit c2fb766

Please sign in to comment.