Skip to content

Commit

Permalink
correct date_of_action to date_of_uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalNewsTV committed Nov 9, 2023
1 parent 752cc0f commit 5365603
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/backend/gwells/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def create_url_list(self, objects, host, bucket_name, private=False):
# split on last occurrence of '/' and return last item (supports any or no prefixes)
'name': unquote_plus(document.object_name).rsplit('/', 1)[-1],
"well_number": self.extract_well_number(document.object_name),
"date_of_upload": self.extract_date_of_action(document.object_name),
"date_of_upload": self.extract_date_of_upload(document.object_name),
"document_type": self.extract_well_label(document.object_name),
"document_status": private
}, objects)
Expand All @@ -138,7 +138,7 @@ def extract_well_number(self, object_name):
except IndexError:
return "Unknown"

def extract_date_of_action(self, object_name):
def extract_date_of_upload(self, object_name):
try:
return int(unquote_plus(object_name).rsplit('/', 1)[-1].split("_")[2].split(".")[0].strip())
except IndexError:
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/src/wells/components/Documents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{{ callLongFormLabel(data.item.document_type) }}
</template>
<template v-slot:cell(date_of_upload)="data">
{{ data.item.date_of_action !== -1 ? new Date(data.item.date_of_upload).toLocaleDateString() : "Date Unknown" }}
{{ data.item.date_of_upload !== -1 ? new Date(data.item.date_of_upload).toLocaleDateString() : "Date Unknown" }}
</template>
<template v-slot:cell(uploaded_document)="data">
<a :href="data.item.url" :download="data.item.name" target="_blank" @click="handleDownloadEvent(data.item.name)">{{ data.item.name }}</a>
Expand Down

0 comments on commit 5365603

Please sign in to comment.