Git Product home page Git Product logo

Comments (3)

sriyash421 avatar sriyash421 commented on July 29, 2024 1

l take this up after the current CDC, so as to not disturb the equilibrium when it's needed the most. @thealphadollar

from mftp.

thealphadollar avatar thealphadollar commented on July 29, 2024

@icyflame @hargup I can see that we have the code for getting attachment from the ERP (L77) but then it is removed as a sanitisation in L108. I'm curious to know why this step has been taken? We should have been sending attachments at some point, I suppose.

Also, do you think providing the attachment URL is of use? I guess not since the links are protected behind ERP auth and hence they will have to login, and ERP does not use referrer head to redirect user post login. Also, the CDC has removed attachments from their public notice board(http://www.cdc.iitkgp.ac.in/notice/Placements) so we cannot put links from there as well.

from mftp.

icyflame avatar icyflame commented on July 29, 2024

I'm curious to know why this step has been taken?

The function removes the raw attachment bytes from the record that's going to be stored in the database. The key is deleted only from the shallow copy of the notice object. The shallow copy isn't the one that's actually sent to the user.

        sanitised_notice = sanitise_notice_for_database(notice)

        # The notice object used to check whether the current notice has already been sent to the
        # user or not => This object does NOT have the attachment_raw key
        db_notice = notices_coll.find_one(sanitised_notice)
        
        if db_notice is None:
            # The notice object that's sent to the user => this does have the attachment_raw key
            different_notices.append(notice)

As long as nothing has changed in the way attachments are stored and returned by the ERP, the existing code should have just continued to work.

from mftp.

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.