certat / do-portal

This project is in maintenance mode and will only receive bug fixes, but no new features. A new version of this software is being developed.
5 stars 5 forks source link

Load CoC on membership page only when requested #13

Closed ghost closed 6 years ago

ghost commented 6 years ago

On https://cp-aec.cert.at/#!/users/6 the CoC should not be loaded by default, only when the user actually accesses it.

The corresponding API call is /api/1.0/users/<id>/memberships AFAIK.

@certrik I guess it also applies to the S/MIME certificate?

certrik commented 6 years ago

Yes. Same applies for S/MIME certificates.

MarkHofstetter commented 6 years ago

app/cp/users.py commit f6efaecb55b1be65635588e1b10a9d24c1a602e8 Author: Mark Hofstetter mark@univie.ac.at Date: Thu Aug 30 14:07:10 2018 +0200

removed BLOBs in /user/<x>/memberships - works only with frontend changes

228 memberships = user.get_memberships() 229 ## XXX only activate with frontend changes ###return ApiResponse({'memberships': [m.serialize(exclude=('coc', 'pgp_key', 'smime')) for m in memberships]}) 230 return ApiResponse({'memberships': [m.serialize() for m in memberships]}) 231

commit c51871106e6989241a5cbe9f337fce7c4f1923f3 Author: Mark Hofstetter mark@univie.ac.at Date: Thu Aug 30 14:38:33 2018 +0200

added users/<int:user_id>/memberships/<int:membership_id> route

frontend then has to use:

233 @cp.route('/users//memberships/', methods=['GET']) 234 def get_cp_users_memberships_by_id(user_id, membership_id): 235 236 user = User.query.get_or_404(user_id) 237 if not g.user.may_handle_user(user): 238 abort(403) 239 membership = user.get_memberships(membership_id) 240 return ApiResponse(memberships)

davewood commented 6 years ago

commit f4090c217a6306238d963d557847519ededb746e Author: David Schmidt mail@davidschmidt.at Date: Wed Sep 5 10:59:40 2018 +0200

download membersip blobs only on demand
davewood commented 6 years ago

bug: when uploading new coc/smime the download/delete button appears, if either is clicked before saving the membership it wont work.

davewood commented 6 years ago

commit 58a43dca9328d1fb195a67aa58a9270aa5f5d16a Author: David Schmidt mail@davidschmidt.at Date: Wed Sep 5 13:19:03 2018 +0200

fix: download works before save now