This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
from time import mktime | |
from datetime import datetime | |
from git import Repo, InvalidGitRepositoryError | |
| |
MAX_COMMITS_TO_GO_BACK = 200 | |
BRANCH_TO_SEARCH = 'analytics-caching' | |
| |
def display_commit(current_commit, previous_commit): | |
changed_files = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
'success' : function(data) { | |
if(data.success) { | |
window.location.reload() | |
} | |
}, | |
'error': function(){ | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
'success' : function(data) { | |
if(data.success) { | |
window.location.reload() | |
} | |
}, | |
'error': function(){ | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TCB.EmployiiMainRouter = Backbone.Router.extend({ | |
/* This is the main router in which everything will eventually go through */ | |
routes : { | |
}, | |
init: function(options) { | |
this.ajax = {}; | |
this.ajax['rapid'] = $.manageAjax.create('rapid', {queue: false}); | |
this.ajax['queue'] = $.manageAjax.create('queue', {queue: true}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TCB.EmployiiMainRouter = Backbone.Router.extend({ | |
/* This is the main router in which everything will eventually go through */ | |
routes : { | |
}, | |
init: function(options) { | |
this.ajax = {}; | |
this.ajax['rapid'] = $.manageAjax.create('rapid', {queue: false}); | |
this.ajax['queue'] = $.manageAjax.create('queue', {queue: true}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(bookmarks)bookmarks # bin/build.sh | |
dropping old database ... | |
creating new database ... | |
migrating .... | |
Operations to perform: | |
Synchronize unmigrated apps: rest_framework, bookmarks, djcelery, users | |
Apply all migrations: admin, contenttypes, auth, sessions | |
Synchronizing apps without migrations: | |
Creating tables... | |
Creating table celery_taskmeta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dehydrate(self, bundle): | |
""" additional attributes for offerings that need to be added to the JSON responses """ | |
from apps.offerings.models import RoadShowEvent | |
from apps.offerings.models import Document | |
################################### | |
# ATTENTION TO WHO THIS MAY CONCERN | |
# | |
# THIS IS A HUGE HACK, but i am over-writing the offering.id to something | |
# random just for admin (important), because stefano wants to display all watchlists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unit tests | |
@override_settings(CELERY_ALWAYS_EAGER = True, BROKER_BACKEND = 'memory') | |
def test_user_should_get_email_when_is_public_is_true_for_PRIMARY_OFFERINGS_ONLY(self): | |
""" | |
issue 952 fix | |
- if offering is primary and is_public goes from false to true then email should be sent | |
- if offering is not primary and is_public goes from false to true no email should be sent | |
""" | |
self.assertEqual(len(mail.outbox),0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_reporting(data): | |
if not data: | |
return (0, 0) | |
unique_ids = list(set(data)) | |
num_unique_vistors = len(unique_ids) | |
# create frequency of visits by user id dict | |
frequency = dict((key, len([k for k in data if k == key])) for key in unique_ids) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on_click_send_individual_email : function(){ | |
var valid = $("#js-template-form").validate().form(); | |
if(!valid) return; | |
var contact_pk = localStorage.getItem('contact_pk'); | |
if(!contact_pk || contact_pk === "null"){ | |
alert("You must select someone to send the email to."); | |
return; | |
} |
NewerOlder