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

Project invitations are always expired #580

Closed
johlton opened this issue Feb 3, 2023 · 7 comments · Fixed by #588
Closed

Project invitations are always expired #580

johlton opened this issue Feb 3, 2023 · 7 comments · Fixed by #588
Assignees
Labels
Milestone

Comments

@johlton
Copy link

johlton commented Feb 3, 2023

Description / Beschreibung

Invitations don't work for us in RDMO 1.9:

  1. Person A adds Person B to an existing project.
  2. Person A sees Person B appearing correctly in the "Invites" panel of the project
  3. Person B gets an email with the invitation link and clicks it
  4. Person B sees RDMO complaining, that the invitation has expired
  5. Person A sees that Person B is removed from the "Invites" panel of the project

We already checked the obvious:

  • Timezone in config/settings/local.py is "Europe/Berlin"
  • Datetimes are corresponding:
    • Server: 2023/02/03 - 14:31:08 CET
    • Mail: 2023/02/03 - 14:31:34 CET

We would assume this is not a Daylight Saving Time problem.
It's even more puzzling cause I see Pull Request 579 which suggests that this should work perfectly.

Expected behaviour / Erwartetes Verhalten

The user is provisioned for the project.

Steps to reproduce / Schritte zum Reproduzieren

  1. Go to 'Project'
  2. Click on 'Add member'
  3. Enter a RDMO User ID
  4. Choose some role
  5. Click "Invite member"
  6. See chosen RDMO User ID in the "Invites" panel
  7. RDMO User clicks the link in the email

References / Verweise

  • There was another person in RDMO Slack (Support-Channel) with exact the same problem (19.01.2023)
@MyPyDavid
Copy link
Member

Hi @johlton , I haven't seen any bug like this yet in our deployment.
The invite expiration is checked here:

if settings.PROJECT_INVITE_TIMEOUT is None:

Did you set a value for PROJECT_INVITE_TIMEOUT in your settings? If so, is the value an appropriate amount of seconds?

@jochenklar
Copy link
Member

Maybe somehow settings.PROJECT_INVITE_TIMEOUT is a string in your case? Or 0?

@johlton
Copy link
Author

johlton commented Feb 3, 2023

Thanks for getting back! I left settings.PROJECT_INVITE_TIMEOUT at False in our local.py:

PROJECT_SEND_INVITE = True
PROJECT_INVITE_TIMEOUT = False

As stated in the docs this should work. But when I see the code, of course it's not gonna work because False is not None, right?

@johlton
Copy link
Author

johlton commented Feb 3, 2023

OK, I changed it to None and now it works. It also works if I use a real value like 259200 (3 days). So, I was just a victim of documentation ;) @MyPyDavid Thanks for pointing that out, I could've had a look in the code myself, sorry for that.

@jochenklar
Copy link
Member

Mhm, I think we should change that to if PROJECT_SEND_INVITE, because a value of 0 makes no sense anyway. Fun fact int(False) is 0 in Python (just tested).

@jochenklar jochenklar added this to the 1.9.3 milestone Feb 3, 2023
@jochenklar jochenklar self-assigned this Feb 3, 2023
@MyPyDavid
Copy link
Member

that is also an unfortunate mismatch between the docs (False) and the code (None) ...

PROJECT_INVITE_TIMEOUT = None

FYI, because False.__int__() is defined as 0 it returns that.. ;)
and False.__float__() returns 0.0
https://docs.python.org/3/library/functions.html#int

bool is even a subclass of int!
https://docs.python.org/3/library/functions.html#bool

@MyPyDavid MyPyDavid modified the milestones: 1.9.3, 1.9.2 Feb 16, 2023
@MyPyDavid
Copy link
Member

a reminder, do you want to take this in 1.9.2 @jochenklar ?

jochenklar added a commit that referenced this issue Feb 23, 2023
@MyPyDavid MyPyDavid linked a pull request Feb 23, 2023 that will close this issue
CalamityC pushed a commit to CalamityC/rdmo that referenced this issue Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants