-
Notifications
You must be signed in to change notification settings - Fork 6
Add verification page before unregistering from event from email #357 #408
base: master
Are you sure you want to change the base?
Conversation
Can you maybe provide a screenshot how this unregister page looks like? Does it work with different screen formats? |
And additionally, could you provide some reasoning about why we need this functionality in the api? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work!
Could you please:
- Provide some reasoning/background on why this feature is required and implemented like this.
- Address the comments in this review.
- Implement tests for the new functionality.
Thank you!
@@ -66,3 +66,6 @@ config.yaml | |||
amivapi/config.yaml | |||
apikeys.yaml | |||
amivapi_storage | |||
|
|||
# Pycharm | |||
.idea/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: missing newline.
Implementation of two stage deletion as per |
bb7a65b
to
188548b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comments. I have some more suggestions.
On a different note: The changes to README.md
seem quite unrelated to this PR. Maybe it would be better to open a separate PR for this, to only keep the relevant changes in this one?
README.md
Outdated
@@ -102,7 +107,7 @@ Now it's time to configure AMIV API. Create a file `config.py` | |||
ROOT_PASSWORD = 'root' | |||
|
|||
# MongoDB Configuration | |||
MONGO_HOST = 'mongodb' | |||
MONGO_HOST = 'mongodb' # or 'localhost' if you run the API from Python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MONGO_HOST = 'mongodb' # or 'localhost' if you run the API from Python | |
MONGO_HOST = 'mongodb' # or 'localhost' if you run the database locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome :D
@@ -257,7 +257,6 @@ | |||
'description': 'Start time of the event itself. If you define ' | |||
'a start time, an end time is required, too.', | |||
'example': '2018-10-17T18:00:00Z', | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to remove this newline? I think it helped the readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah... for me it is the contrary, it is disturbing, as it should be part of the same json structure on the same level, I thought that it was clearer to keep it on one level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I would add the line again, as this has nothing to do with the feature of this PR.
@@ -269,7 +268,6 @@ | |||
'description': 'End time of the event itself. If you define ' | |||
'an end time, a start time is required, too.', | |||
'example': '2018-10-17T22:00:00Z', | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to remove this newline? I think it helped the readability.
Is that ok? | ||
{% else %} | ||
You clicked on a opt-out link of the AMIV at ETHZ student organization. We cannot process your request, | ||
because we either do <em>{not}</em> know the event you wish to unregister from, or your user name, or both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats up with the curly braces around the not? Is this some special html syntax I don't know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed XD
@@ -62,11 +62,13 @@ | |||
REMOTE_MAILING_LIST_ADDRESS = None | |||
REMOTE_MAILING_LIST_KEYFILE = None | |||
REMOTE_MAILING_LIST_DIR = './' # Use home directory on remote by default | |||
# Signups via email (@email_blueprint.route('/delete_signup/<token>') in email_links.py) | |||
# DEFINITIVE_DELETE = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out? Is it needed?
amivapi/settings.py
Outdated
|
||
# SMTP server defaults | ||
API_MAIL = '[email protected]' | ||
API_MAIL_SUBJECT = "[AMIV] {subject}" | ||
SMTP_HOST = 'localhost' | ||
SMTP_HOST = 'localhost' # None in case you want to accept that no mails get sent (local testing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I understand the comment now. But what exactly is the problem with leaving it on localhost for local testing? Is there some error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it because I haven't been able to reproduce any error.
Note: I have updated this branch to the new master branch, make sure to pull before working on it again. |
When users are upgraded to members via LDAP, subscribe them to the newsletter. Newsletter settings of already imported members are not touched. Closes amiv-eth#400
- Add documentation for position field. - Add position field to post response. Fixes amiv-eth#405 Fixes amiv-eth#410
Even if FCFS in enabled, admins should be allowed to force a signup to be accepted. This worked as intended for PATCH requests already, and now also works for POST. Fixes amiv-eth#381
ad77da0
to
09ff765
Compare
09ff765
to
f10dc1d
Compare
d120e26
to
8dbe85f
Compare
@temparus I believe the base is working. Haven't changed much. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your continued work!
Most of all, thank you for adding tests. However, I am currently having a hard time to understand what is being tested, and what the expected functionality is, so I can't really judge whether the tests are sufficient or not.
Please try to:
- break the tests up a little,
- explain the expected behavior more.
This would be greatly appreciated!
I have a few nitpicks here and there as well, please try to address them, too.
# Create a network so that the api service can later be connected to the db | ||
docker network create --driver overlay backend | ||
|
||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to serve no purpose?
@@ -169,30 +174,31 @@ docker service create \ | |||
--name amivapi-cron --network backend \ | |||
--config source=amivapi_config,target=/api/config.py \ | |||
amiveth/amivapi amivapi cron --continuous | |||
|
|||
# To attach your command line to the docker instance, use | |||
docker attach amivapi... # Use tab completion to find the name of the service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it: This is not at all how one should use a docker service, and not really required for the amivapi, so I don't think we should recommend this here.
return "Unknown token" | ||
|
||
# Verify if user confirmed | ||
# definitive = request.args.get('DEFINITIVE_DELETE') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this comment serve any purpose?
@@ -257,7 +257,6 @@ | |||
'description': 'Start time of the event itself. If you define ' | |||
'a start time, an end time is required, too.', | |||
'example': '2018-10-17T18:00:00Z', | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I would add the line again, as this has nothing to do with the feature of this PR.
self.api.get('/delete_signup/%s' % token, status_code=302) | ||
self.api.get('/eventsignups/%s' % signup['_id'], status_code=200) | ||
self.api.get('/delete_signup/%s' % token, status_code=200) | ||
self.api.post('/delete_confirmed/%s' % token, status_code=302) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding tests ... unfortunately I do not understand at all what is going on here, and why e.g. in this last line a status code 302
is expected.
As the flow is now considerably more complicated, please either:
- Split this test up into multiple tests that are clear about which part is being tested.
- If it is impossible to split them up, please modify the docstring to explain the expected behavior.
The more I look at it, the more I think our original tests here are already confusing. I would greatly appreciate it if you could try to split the tests up a bit more to make them more understandable.
No description provided.