ScilifelabDataCentre / dds_web

A cloud-based system for the delivery of data from SciLifeLab Facilities to their users (e.g. research group).
Other
8 stars 8 forks source link

Expired link is deleted from database when expired #1466

Closed rv0lt closed 1 year ago

rv0lt commented 1 year ago

Before submitting this PR

  1. Description: When an invite is sent, the expiry time is set to exactly 7 days from now (incl the time). At midnight there is a cronjob which finds the expired invites in the Invites table and removes them. This means that there is a gap between the actual expiry and when the invite is deleted from the database. This PR fixes that. As well as adding some tests

  2. Jira task / GitHub issue: https://scilifelab.atlassian.net/jira/software/projects/DDS/boards/13?isInsightsOpen=true&selectedIssue=DDS-1642

  3. How to test: Add information on how someone could manually test this functionality. As detailed as possible.

  4. Type of change: Check the relevant boxes in the section below

  5. Add docstrings and comments to code, even if you personally think it's obvious.

What type of change(s) does the PR contain?

Checklist

Actions / Scans

codecov[bot] commented 1 year ago

Codecov Report

Merging #1466 (753ead3) into dev (ca45daf) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev    #1466      +/-   ##
==========================================
+ Coverage   90.11%   90.15%   +0.03%     
==========================================
  Files          29       29              
  Lines        4401     4407       +6     
==========================================
+ Hits         3966     3973       +7     
+ Misses        435      434       -1     
Files Changed Coverage Δ
dds_web/api/schemas/user_schemas.py 88.88% <100.00%> (+0.65%) :arrow_up:
dds_web/api/user.py 90.63% <100.00%> (+0.20%) :arrow_up:
rv0lt commented 1 year ago

@i-oden You mean adding tests that check that the ProjectInviteKeys are removed right?

i-oden commented 1 year ago

@i-oden You mean adding tests that check that the ProjectInviteKeys are removed right?

@rv0lt Correct!

rv0lt commented 1 year ago

@i-oden like this changes I push you mean? I dont know How to check for example for the ddserr.databaseerror as that was already part of the code I just move it around.

i-oden commented 1 year ago

@i-oden like this changes I push you mean? I dont know How to check for example for the ddserr.databaseerror as that was already part of the code I just move it around.

What you've added now is a good start, but you'll need to change a bit and add a bit of code too. I can have a look tomorrow again and come with a suggestion!