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

Drops a Grants Twitter verification if the user modifies the twitter_handle_1 field #8305

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/assets/v2/js/grants/_detail-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ Vue.mixin({
vm.grant.description_rich = JSON.stringify(vm.$refs.myQuillEditor.quill.getContents());
vm.grant.description = vm.$refs.myQuillEditor.quill.getText();
vm.grant.image_css = `background-color: ${vm.logoBackground};`;
if (vm.grant_twitter_handle_1 != vm.grant.twitter_handle_1) {
vm.grant.verified = false;
}
vm.grant_twitter_handle_1 = vm.grant.twitter_handle_1;
vm.$root.$emit('bv::toggle::collapse', 'sidebar-grant-edit');
_alert('Updated grant.', 'success');

Expand Down Expand Up @@ -532,7 +536,7 @@ Vue.component('grant-details', {
},
mounted: function() {
let vm = this;

vm.grant_twitter_handle_1 = vm.grant.twitter_handle_1;
vm.grant.description_rich_edited = vm.grant.description_rich;
if (vm.grant.description_rich_edited) {
vm.editor.updateContents(JSON.parse(vm.grant.description_rich));
Expand Down
7 changes: 6 additions & 1 deletion app/grants/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,12 @@ def grant_edit(request, grant_id):
response['message'] = 'error: enter your twitter handle e.g @georgecostanza'
return JsonResponse(response)

grant.twitter_handle_1 = twitter_handle_1
if grant.twitter_handle_1 != twitter_handle_1:
grant.twitter_verified = False
grant.twitter_verified_by = None
grant.twitter_verified_at = None
grant.twitter_handle_1 = twitter_handle_1

grant.twitter_handle_2 = twitter_handle_2

reference_url = request.POST.get('reference_url', None)
Expand Down