ccad96ea03e77dbce00423f339e7bec58159187a,api/data_refinery_api/views.py,DatasetView,perform_update,#DatasetView#Any#,424

Before Change


                            "username": "EngagementBot",
                            "icon_emoji": ":halal:",
                            "attachments":[
                                {   "color": "good",
                                    "text": new_user_text
                                }
                            ]
                        }
                        response = requests.post(
                            webhook_url,

After Change


                        except Exception:
                            city = "COULD_NOT_DETERMINE"

                        user_agent = self.request.META.get("HTTP_USER_AGENT", None)
                        response = requests.post(
                            settings.ENGAGEMENTBOT_WEBHOOK,
                            json={
                                "channel": "ccdl-general", // Move to robots when we get sick of these
                                "username": "EngagementBot",
                                "icon_emoji": ":halal:",
                                "attachments": [
                                    {
                                        "color": "good",
                                        "title": "New dataset download",
                                        "fallback": "New dataset download",
                                        "title_link": "http://www.refine.bio/dataset/" + str(old_object.id),
                                        "text": "New user " + supplied_email_address + " from " + city + " downloaded a dataset!",
                                        "footer": "Refine.bio | " + remote_ip + " | " + user_agent,
                                        "footer_icon": "https://s3.amazonaws.com/refinebio-email/logo-2x.png",
                                        "fields": [
                                            {
                                                "title": "Dataset id",
                                                "value": str(old_object.id),
                                                "short": True
                                            },
                                            {
                                                "title": "Total",
                                                "value": Dataset.objects.filter(email_address=supplied_email_address).count(),
                                                "short": True
                                            }
                                        ]
                                    }
                                ]
                            },
                            headers={"Content-Type": "application/json"},
                            timeout=10
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: AlexsLemonade/refinebio
Commit Name: ccad96ea03e77dbce00423f339e7bec58159187a
Time: 2019-12-27
Author: arielsvn@gmail.com
File Name: api/data_refinery_api/views.py
Class Name: DatasetView
Method Name: perform_update


Project Name: comic/grand-challenge.org
Commit Name: 8c85a43999fbff2c2837957218681859a7278f91
Time: 2020-01-28
Author: 57257130+MikeOverkamp-diag@users.noreply.github.com
File Name: app/grandchallenge/reader_studies/models.py
Class Name: ReaderStudy
Method Name: statistics


Project Name: comic/grand-challenge.org
Commit Name: 8b2e74b8abd5fd3734666d1c2c432d87ba5c93c6
Time: 2020-04-07
Author: 12661555+jmsmkn@users.noreply.github.com
File Name: app/grandchallenge/archives/views.py
Class Name: ArchiveDetail
Method Name: get_context_data