activist-org / activist

An open-source activism platform
https://activist.org
GNU Affero General Public License v3.0
221 stars 184 forks source link

Creating Serializers with Standard Field Validation #295

Closed momanyisamuel closed 1 year ago

momanyisamuel commented 1 year ago

Terms

Description

To ensure data integrity and maintain consistent data quality across activist-org's Django Rest Framework (DRF) api, we need to implement serializers that enforce standard validation for fields. By enforcing validation rules consistently across the project, we can prevent incorrect or invalid data from entering our system and enhance the reliability of activist-org's API.

Proposed Task: The proposed task involves creating custom serializers - given all the models have been defined - that enforce standard validation rules for fields. By implementing these rules within the serializers, we can ensure that incoming data adheres to predefined criteria before being processed and stored.

LATER - we can look at implementing custom validators

Contribution

Happy to support someone on this issue or work on it myself

thiagogquinto commented 1 year ago

Hey @momanyisamuel , I am new in open source community, I would like to take a look in the source code before I decide to develop this task, so could you assign me to the task, please? If I change my mind I update you about it.

andrewtavis commented 1 year ago

Hey @thiagogquinto! Thanks for your interest in activist :) I'll assign you, and please let us know if there's anything we can do to help!

thiagogquinto commented 1 year ago

Hey @andrewtavis, sorry for taking so long, I had some problems, but I just want to update and tell you that I am working on the issue,

andrewtavis commented 1 year ago

Hey @thiagogquinto 😊 Not a problem :) I appreciate you communicating with us on the progress! Please let us know if you want to discuss it further or need some help.

kurtisolo commented 1 year ago

I can help with this, if needed :) (sorry for my absence btw @andrewtavis )

andrewtavis commented 1 year ago

Thanks for offering to help, @kurtisolo, and no stress on any absence :) Let's give @thiagogquinto a bit more time to work on this :) @thiagogquinto, @kurtisolo would also be a great resource to ask for help on this 😊 Take your time and we'll get this done! 🚀

@kurtisolo, we'll have a few more backend issues from @momanyisamuel later on today :) Would be great to have you in the sync tomorrow, btw!

thiagogquinto commented 1 year ago

Thanks for offering to help, @kurtisolo, and no stress on any absence :) Let's give @thiagogquinto a bit more time to work on this :) @thiagogquinto, @kurtisolo would also be a great resource to ask for help on this 😊 Take your time and we'll get this done! 🚀

@kurtisolo, we'll have a few more backend issues from @momanyisamuel later on today :) Would be great to have you in the sync tomorrow, btw!

I am sorry, I took this task to understand Django, but I want to ensure that I don't disrupt the project's progress. My idea is to submit a pull request with the changes (as a preview) later today. I would greatly appreciate it if someone could take a look at my code and provide some feedback. My goal is to push the final code by Monday at the latest. If I see that this won't be possible, I'll let you know, and then you can assign it to somebody else. Does that sound good?

momanyisamuel commented 1 year ago

@thiagogquinto that sounds great looking forward to your pull request 👍

andrewtavis commented 1 year ago

Ya this is perfect, @thiagogquinto! Happy to discuss when the PR is up 😊

andrewtavis commented 1 year ago

358 and cc451f7 close this :) As mentioned in the PR, it'd be great to know if there's a standard formatting for the validation errors. My assumption is that these should be complete sentences, and if we agree on this then we can make a good first issue to get this done :)

Thanks so much @thiagogquinto for the hard work here and also @momanyisamuel for the issue and @kurtisolo for the support/review!

thiagogquinto commented 1 year ago

@andrewtavis , thank you for the opportunity to let me work on the project. As mentioned, you inquired about standard formatting for validation errors, and I started researching and found this. I will continue searching, and if you think that's okay, I could work on it.

andrewtavis commented 1 year ago

Yes, @thiagogquinto, some research on this would be great and you'd be very welcome to expand on the work you've already done! Do you want to make a new issue for this, or should I?

thiagogquinto commented 1 year ago

Yes, @thiagogquinto, some research on this would be great and you'd be very welcome to expand on the work you've already done! Do you want to make a new issue for this, or should I?

Thanks, you can make the issue.

andrewtavis commented 1 year ago

See #376, @thiagogquinto! Would be great if you could write in there so that I can assign it to you :)