Skip to content

Conversation

@maze-runnar
Copy link
Contributor

Fixes #5040
Screenshot from 2021-01-13 16-19-44

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Jan 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/qim4rv6gu
✅ Preview: https://open-event-frontend-git-fork-maze-runnar-verification.eventyay.vercel.app

@maze-runnar
Copy link
Contributor Author

maze-runnar commented Jan 13, 2021

@iamareebjamal this is currently giving me this error on changing the sate of is_verified (for testing I have also made is_verified dump_only in server too, but that also gave same error) -
Screenshot from 2021-01-13 16-17-21
Screenshot from 2021-01-13 16-17-01

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #6355 (5f543c2) into development (ae3d64c) will increase coverage by 0.10%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #6355      +/-   ##
===============================================
+ Coverage        22.71%   22.81%   +0.10%     
===============================================
  Files              520      524       +4     
  Lines             5745     5803      +58     
  Branches           113      113              
===============================================
+ Hits              1305     1324      +19     
- Misses            4413     4452      +39     
  Partials            27       27              
Impacted Files Coverage Δ
app/controllers/admin/users/list.js 0.00% <0.00%> (ø)
app/models/user.js 0.00% <ø> (ø)
app/components/public/speaker-item.js 33.33% <0.00%> (-33.34%) ⬇️
app/components/modals/simple-modal.js 20.00% <0.00%> (-13.34%) ⬇️
...pp/components/events/view/overview/manage-roles.js 2.63% <0.00%> (-3.83%) ⬇️
app/controllers/public.js 17.64% <0.00%> (-1.11%) ⬇️
app/router.js 100.00% <0.00%> (ø)
app/models/event.js 31.57% <0.00%> (ø)
app/routes/orders/new.js 0.00% <0.00%> (ø)
app/routes/orders/view.js 0.00% <0.00%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae3d64c...5f543c2. Read the comment docs.

@iamareebjamal
Copy link
Member

  1. Making it dump_only makes it read only, which will make it not work even more
  2. See the request body to know why it is throwing error

@maze-runnar
Copy link
Contributor Author

"marketer-events":{"data":[{"type":"event","id":"3e44abb2"},{"type":"event","id":"0ccd0d34"},{"type":"event","id":"bf0a821f"},{"type":"event","id":"3b67cff2"},{"type":"event","id":"53170e0a"},{"type":"event","id":"a68ec65f"},{"type":"event","id":"825d4796"}]},"sales-admin-events":{"data":[{"type":"event","id":"3e44abb2"}

sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for integer: "3e44abb2"
LINE 3: WHERE events.id = '3e44abb2'

@maze-runnar
Copy link
Contributor Author

maze-runnar commented Jan 13, 2021

complete payload -

{"data":{"id":"2","attributes":{"email":"[email protected]","is-blocked":true,"is-admin":false,"is-user-owner":false,"is-user-organizer":false,"is-user-coorganizer":false,"is-user-track-organizer":false,"is-user-moderator":false,"is-user-registrar":false,"is-sales-admin":false,"is-marketer":false,"was-registered-with-order":false,"first-name":null,"last-name":null,"details":null,"contact":null,"avatar-url":null,"icon-image-url":null,"small-image-url":null,"thumbnail-image-url":null,"original-image-url":null,"facebook-url":null,"instagram-url":null,"twitter-url":null,"google-plus-url":null,"deleted-at":null,"billing-contact-name":null,"billing-phone":null,"billing-country":null,"company":null,"billing-address":null,"billing-city":null,"billing-zip-code":null,"billing-tax-info":null,"billing-additional-info":null,"billing-state":null},"relationships":{"owner-events":{"data":[]},"organizer-events":{"data":[]},"coorganizer-events":{"data":[]},"track-organizer-events":{"data":[]},"registrar-events":{"data":[]},"moderator-events":{"data":[]},"marketer-events":{"data":[{"type":"event","id":"3e44abb2"},{"type":"event","id":"0ccd0d34"},{"type":"event","id":"bf0a821f"},{"type":"event","id":"3b67cff2"},{"type":"event","id":"53170e0a"},{"type":"event","id":"a68ec65f"},{"type":"event","id":"825d4796"}]},"sales-admin-events":{"data":[{"type":"event","id":"3e44abb2"},{"type":"event","id":"0ccd0d34"},{"type":"event","id":"bf0a821f"},{"type":"event","id":"3b67cff2"},{"type":"event","id":"53170e0a"},{"type":"event","id":"a68ec65f"},{"type":"event","id":"825d4796"}]}},"type":"user"}}

@iamareebjamal
Copy link
Member

Exactly. event ID is identifier instead of id

@maze-runnar
Copy link
Contributor Author

Exactly. event ID is identifier instead of id

but I am passing only user id, and how to paas event id in toggleBlocked?

@iamareebjamal
Copy link
Member

See event relation serializer

@maze-runnar
Copy link
Contributor Author

The error is comming due to these relation. What to do next?

# owner_events = Relationship(
    #     self_view='v1.user_owner_events',
    #     self_view_kwargs={'id': '<id>'},
    #     related_view='v1.event_list',
    #     related_view_kwargs={'user_owner_id': '<id>'},
    #     schema='EventSchema',
    #     many=True,
    #     type_='event',
    # )
    organizer_events = Relationship(
        self_view='v1.user_organizer_events',
        self_view_kwargs={'id': '<id>'},
        related_view_kwargs={'user_organizer_id': '<id>'},
        related_view='v1.event_list',
        schema='EventSchema',
        many=True,
        type_='event',
    )
    coorganizer_events = Relationship(
        self_view='v1.user_coorganizer_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_coorganizer_id': '<id>'},
        schema='EventSchema',
        many=True,
        type_='event',
    )
    track_organizer_events = Relationship(
        self_view='v1.user_track_organizer_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_track_organizer_id': '<id>'},
        schema='EventSchema',
        many=True,
        type_='event',
    )
    registrar_events = Relationship(
        self_view='v1.user_registrar_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_registrar_id': '<id>'},
        schema='EventSchema',
        many=True,
        type_='event',
    )
    moderator_events = Relationship(
        self_view='v1.user_moderator_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_moderator_id': '<id>'},
        schema='EventSchema',
        many=True,
        type_='event',
    )

marketer_events = Relationship(
        self_view='v1.user_marketer_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        schema='EventSchema',
        type_='event',
        many=True,
    )
    sales_admin_events = Relationship(
        self_view='v1.user_sales_admin_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        schema='EventSchema',
        type_='event',
        many=True,
    )

@iamareebjamal
Copy link
Member

It's issue in frontend, not server, see event relation serializer

@maze-runnar
Copy link
Contributor Author

I have reverted changes of event-relation to previous version but still getting the same error.

@iamareebjamal iamareebjamal changed the title wip: Enable admins to change system roles of users from "Unverified" to "Verified" feat: Enable admins to change users from "Unverified" to "Verified" Jan 17, 2021
@auto-label auto-label bot added the feature label Jan 17, 2021
@iamareebjamal iamareebjamal merged commit 02570fb into fossasia:development Jan 17, 2021
@maze-runnar maze-runnar deleted the verification branch May 26, 2021 09:51
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 this pull request may close these issues.

Enable admins to change system roles of users from "Unverified" to "Verified"

2 participants