Repository: hydroshare/hydroshare

Issue:
Resource Landing page reports that a DOI is pending for 2 weeks, but the DOI is active.
**Description of the bug**
A user published a resource 2.5 weeks ago, and since then the "Note that the DOI will not be available until it has been registered and activated" message has remained. I have checked the DOI, it is registered and active. The pending publication message also still appears at the end of the generated citation/ 

Steps to reproduce the bug:
1. Go to https://www.hydroshare.org/resource/18db8e1da5354e318b57e9d873fd5e35/


**Expected behavior**
The pending publication notices should disappear when the DOI is minted, this typically does not take more than a few hours if that.  

**Additional information**

<img width="1135" alt="Screen Shot 2022-05-03 at 4 22 11 PM" src="https://user-images.githubusercontent.com/90924476/166559593-a8bb45b0-5e05-4e36-be03-c399b99495f1.png">




Discussion:
@devincowan could you please take a look at it. Please reach out to Hong if you have questions as she did the initial implementation I believe.
@devincowan @ClaraCogswell @martinseul I fixed this resource by manually updating this resource in the database to remove "pending" from its doi field. This action should be done automatically in a nightly run celery task to check with crossref API when the DOI was initially resolved, but for some reason was not done for this resource. It could be a hiccup from crossref which did not set a resolved field for this resource when the nightly job ran to check pending publication resources, or something on our side, e.g., somehow the nightly job was not run for some reason. I am not sure exactly how this happened for this resource, but I have manually fixed it and it looks good now. If we run into more issues like this with pending publication resources, I'll look into it deeper. Otherwise, I'd assume this is a one-off instance which I have already manually fixed.
Thank you Hong!
I will check to verify that the celery task is working for other resources (unless someone else has already--LMK)
From what I can see, the[ celery task ](https://github.com/hydroshare/hydroshare/blob/develop/hs_core/tasks.py#L97) seems to be functioning. Martin and I were thinking that maybe this particular resource got skipped due to the power outage. But the celery task runs nightly at midnight so I don't see why it wouldnt have resolved the next night...

I thought just to be sure, we could find a pending resource and check back to make sure that it resolves in a couple weeks. I queried our [api endpoint](https://www.hydroshare.org/hsapi/resource/?published=true) for doi containing "pending" and don't find any right now.

I'm okay with closing this if @ClaraCogswell is
I'm fine with closing!
This issue has reappeared and is now affecting additional resources going back to early May this is critical, @hyi, @devincowan could you please coordinate and look into a solution asap.
Please see https://www.hydroshare.org/resource/d2a724a994b34fa3880ca21562912788/ or https://www.hydroshare.org/resource/89cfde573936487a9ab4ff406638465b/ 

Resolving patch:
diff --git a/hs_core/tasks.py b/hs_core/tasks.py
--- a/hs_core/tasks.py
+++ b/hs_core/tasks.py
@@ -140,7 +140,8 @@ def manage_task_nightly():
                                                    USERNAME=settings.CROSSREF_LOGIN_ID,
                                                    PASSWORD=settings.CROSSREF_LOGIN_PWD,
                                                    DOI_BATCH_ID=res.short_id,
-                                                   TYPE='result'))
+                                                   TYPE='result'),
+                                    verify=False)
             root = ElementTree.fromstring(response.content)
             rec_cnt_elem = root.find('.//record_count')
             failure_cnt_elem = root.find('.//failure_count')


Test patch: