Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of Endpoints for reupload, download and remove documents functionality #56

Conversation

Parth858
Copy link
Contributor

Download/Upload/remove functionality for media files such as resume, cover letter and profile picture has added as well as these media files will also be stored locally in the media folder according to filename.

@@ -597,6 +598,104 @@ def get_application_status(self, serialized_data):

return serialized_data

@action(detail=True, methods=["put"])
def reupload_documents(self, request, pk=None):
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request: Base Api/user/be9ccc8b-d8c9-42f7-b776-dfef4649f39f/reupload_documents/
response: {
        "user_id": "be9ccc8b-d8c9-42f7-b776-dfef4649f39f",
        "name": "Devid gutta",
        "about": null,
        "resume": "http://127.0.0.1:3000/media/resume/resume_t9X71uc.pdf",
       "profile_picture":"http://127.0.0.1:3000/media/profile_picture/profile.pdf",
        "cover_letter": "http://127.0.0.1:3000/media/cover_letter/CV.pdf",
        "user_type": "Job Seeker",
        "experience": "0",
        "qualification": null,
        ...


@action(detail=True, methods=["get"])
def download_documents(self, request, pk=None):
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request:Base Api/user/be9ccc8b-d8c9-42f7-b776-dfef4649f39f/download_documents?document_type=cover_letter
response: New page will appear which gives option to save as pdf into local system.


@action(detail=True, methods=["delete"])
def remove_documents(self, request, pk=None):
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request: Base Api/user/be9ccc8b-d8c9-42f7-b776-dfef4649f39f/remove_documents/?document_type=resume
response: {
    "user_id": "be9ccc8b-d8c9-42f7-b776-dfef4649f39f",
    "name": "Devid gutta",
    "about": null,
    "resume": null,
    "profile_picture": "http://127.0.0.1:3000/media/profile_picture/profile.pdf.pdf",
    "cover_letter": "http://127.0.0.1:3000/media/cover_letter/cv.pdf",
    "user_type": "Job Seeker",
    "experience": "0",
    "qualification": null,
    ...

@HimanshuSharma-Angel
Copy link
Collaborator

@Himan10 please check the authorization things, only authorized people are allowed to see their file.

@@ -319,38 +324,38 @@ def featured_jobs(self, request):
"""

# past 3 weeks datetime specified for featured jobs (can be modified as per use)
past_3_weeks_datetime = datetime_safe.datetime.now(tz=timezone.utc) - timedelta(days=18)
past_3_weeks_datetime = datetime_safe.datetime.now(tz=timezone.utc) - timedelta(
days=18
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put it constants

)

# Remove the document based on the requested document type
if document_type == "resume":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this value in constants

Copy link
Collaborator

@HimanshuSharma-Angel HimanshuSharma-Angel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please prepare yourself for demo tomorrow

@YogeshUpdhyay YogeshUpdhyay merged commit 5c9ce5e into null-open-security-community:main Jan 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants