Giter VIP home page Giter VIP logo

Comments (16)

willingc avatar willingc commented on June 20, 2024

@jayesh92 Thanks for opening an issue. Nice sharing of knowledge and teamwork.

Some quick tips for all on issue communications:

  • Think about the reader's perspective. Can I, as the reader, quickly and easily understand the issue? Where to look for details? Remember many developers are actively working on multiple projects. This requires a developer to do a mental context switch each time they switch projects. Remember that you know the details of the issue but the project maintainer may need a bit of higher level background.
  • Try to use the GitHub markdown to make the issue more user friendly (good job to @jayesh92 and @vubo on this)
  • Break up into different paragraphs:
    • high level issue,
    • steps (if known to replicate issue),
    • possible cause (if known),
    • possible next actions for collaboration on issue

I'm going to reformat the original issue to see if I have understanding of the issue.

from vms.

willingc avatar willingc commented on June 20, 2024

The functional test "check if admin can access a volunteer view" is failing. The test can be viewed at jayesh92@45a3993#diff-0df96ededa86aa47a9dbdb5655a6908aR177 .

I've created an admin account and tried to browse url /shift/view_volunteer_shifts/1 which is meant to be a volunteer view. I get a 500 error instead of 403.

The code for view being tested is https://github.com/systers/vms/blob/develop/vms/shift/views.py#L285 .

Suggestions: The problem here is at line 290, since it's an admin account it's volunteer field will be None and we can't access its 'id'. It would be better if we first check if its not a volunteer and then raise a 403 or better we create a decorator to check admin and use this for all volunteer views.

[My reformatting of @jayesh92's original issue with two minor edits]

from vms.

willingc avatar willingc commented on June 20, 2024

Questions on the vms project functionality:

  • What is the purpose of view_volunteer_shifts?
  • How does an admin view volunteer shifts of another volunteer?
  • What happens if an admin is also a volunteer?

My recommendation, before addressing the testing issue, would be to address these questions and create a docstring for the function (view_volunteer_shifts) to clarify expected behavior of the function.

After that, I recommend @vubo and @jayesh92 work together to determine if the desired behaviors are being covered properly by functional tests and create a plan to do so.

Thanks!

from vms.

jayesh92 avatar jayesh92 commented on June 20, 2024
  • view_volunteer_shifts shows the shifts which the volunteer has either registered for or have been assigned by an admin. He can cancel or log hours from this view.
  • Admin can generate report to see logged in hours of a shift.
  • Not sure on this

@Nerdylicious can tell more about the desired functionality about this issue.

from vms.

Nerdylicious avatar Nerdylicious commented on June 20, 2024

Hi everyone,

  • Jayesh is on the right track with how to fix this issue (as he described above). I didn't have time to fix this part before GSOC. There may be other views with a similar issue as this that must be fixed.
  • The admin can view the shifts of a volunteer when they manage the shifts of the volunteer (this functionality is in manage_volunteer_shifts in /shift/views.py
  • For now, only administrators are only allowed to manage (create/update/delete) events, jobs, shifts and pull reports. You might want to ask Rose if she wants admins to also be volunteers.

from vms.

vubo avatar vubo commented on June 20, 2024

Thank you @jayesh92 for opening an issue. I will get around to it. This part is also in my timeline (22 June-19 July).

@rosariorobinson could you tell please, can admins also be volunteers? And if yes, what should happen if an admin is also a volunteer?

from vms.

willingc avatar willingc commented on June 20, 2024

@jayesh92 I'm reviewing open issues. I noticed that your travis.yml file is using Python 2.7. We are currently using Python 3.4 for development. You may wish to add that to your travis file.

from vms.

jayesh92 avatar jayesh92 commented on June 20, 2024

@willingc I'll add that

from vms.

willingc avatar willingc commented on June 20, 2024

Thanks @jayesh92. It may help catch some issues sooner versus later. Also Travis can test both Python versions if desired.

from vms.

jayesh92 avatar jayesh92 commented on June 20, 2024

@willingc We can configure travis to run for PY2 and PY3. I guess it would be good to do so once we have a good compatibility file to take care of differences in coding practices of PY2 and PY3

from vms.

rosariorobinson avatar rosariorobinson commented on June 20, 2024

@vubo ... Yes, admins can be volunteers. Because they are admins, they should still be able to visit a volunteer job/position and sign up as they were just a volunteer. I think I see admins as just a different view than others with additional functionality. They should be able to view VMS as a volunteer as well.

Let me know if you need more clarity.

from vms.

willingc avatar willingc commented on June 20, 2024

@jayesh92 @vubo Can this issue be closed out or are the tests still failing?

from vms.

vubo avatar vubo commented on June 20, 2024

@willingc yes, I fixed it: #99

from vms.

willingc avatar willingc commented on June 20, 2024

Thanks @vubo. I am closing this issue based on latest merged PR #99.

@jayesh92 Feel free to reopen if needed.

from vms.

jayesh92 avatar jayesh92 commented on June 20, 2024

fine by my side

from vms.

willingc avatar willingc commented on June 20, 2024

Thanks @jayesh92 :)

from vms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.