This file contains 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_phone_listeners(user) | |
stations = user.stations | |
return nil unless stations.present? | |
phone_listeners = NowSession.joins("LEFT JOIN data_gateway ON data_gateway.id=now_session.call_gateway_id").select("now_session.call_ani_e164").where("now_session.call_ani_e164 <> ''").where(call_gateway_id: stations.map(&:id)) | |
end | |
def area_code_for_listener(listener) | |
listener[0].slice(0,3) if listener[0].to_s.length == 11 && listener[0].to_s.slice!(0) == "1" | |
end |
This file contains 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 smtplib | |
import sys, argparse | |
import re | |
import base64 | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
def banner(): | |
print "#################################" | |
print "# PyPhisher #" |
This file contains 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 smtplib | |
import sys, argparse | |
import re | |
import base64 | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
def banner(): | |
print "#################################" | |
print "# PyPhisher #" |
This file contains 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 smtplib | |
import sys, argparse | |
import re | |
import base64 | |
import os | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
def banner(): | |
print "#################################" |
This file contains 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
// ---- | |
// libsass (v3.2.2) | |
// ---- | |
.single-list { | |
article { | |
ol { | |
padding: 0; | |
li { | |
font-size: 10px; |
This file contains 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
// ---- | |
// libsass (v3.2.2) | |
// ---- | |
.single-list article ol { | |
padding: 0; | |
li { | |
font-size: 10px; | |
.credit { | |
color: black; |
This file contains 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
from classes import worker | |
from pages.frontend import ArticlePage | |
from classes import seleniumDriver | |
import time,datetime,unittest,sys | |
from selenium.webdriver.support.wait import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
from classes import PageActions as pgactions | |
from configobj import ConfigObj | |
from pages.backend import AddArticlePage as AP |
This file contains 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_context_data(self, **kwargs): | |
context = super(ServiceDetail, self).get_context_data(**kwargs) | |
extra_fields = self.object.service_type.required_inputs() | |
form = ServiceForm(instance=self.object, extra_fields=extra_fields) | |
for field in extra_fields: | |
input_value = ServiceInput.objects.get(service=self.object, key=field).value | |
form.fields['custom_%s' % field].initial = input_value | |
context['form'] = form |
This file contains 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
class ProjectDisplay(LoginRequiredMixin, DetailView): | |
model = Project | |
context_object_name = 'project' | |
def get_context_data(self, **kwargs): | |
context = super(ProjectDisplay, self).get_context_data(**kwargs) | |
context['form'] = ServiceTypeForm() | |
return context | |
This file contains 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
class ProjectViewsTest(TestCase): | |
def setUp(self): | |
self.project = Project.objects.create(name='google') | |
self.request = RequestFactory().get('/fake-path/') | |
def test_project_display_context_data(self): | |
view = ProjectDisplay() | |
view = setup_view(view, self.request, slug=self.project.slug) | |
self.assertIn('form', view.get_context_data()) |
OlderNewer