diff --git a/.env_sample b/.env_sample index 049b1e312..c933a8705 100644 --- a/.env_sample +++ b/.env_sample @@ -1,4 +1,3 @@ -SUNLIGHT_API_KEY="" GOOGLE_MAP_API_KEY= DJANGO_SECRET_KEY= PROPUBLICA_API_KEY= diff --git a/project/api/models/bill.py b/project/api/models/bill.py index 0aeb10798..95352902a 100644 --- a/project/api/models/bill.py +++ b/project/api/models/bill.py @@ -5,13 +5,12 @@ class BillSources: - SUNLIGHT = "sunlight" # we don't use sunlight in current implementation is just relic of the past PROPUBLICA = "propublica" - SOURCES = [(SUNLIGHT, SUNLIGHT), (PROPUBLICA, PROPUBLICA)] + SOURCES = [(PROPUBLICA, PROPUBLICA)] class Bill(models.Model): - id = models.CharField(max_length=255, primary_key=True) # from sunlight + id = models.CharField(max_length=255, primary_key=True) title = models.CharField(max_length=1023) short_title = models.CharField(max_length=1023) diff --git a/project/api/write.py b/project/api/write.py index 851231008..eb3f6492f 100644 --- a/project/api/write.py +++ b/project/api/write.py @@ -236,31 +236,6 @@ def deleteCivi(request): return HttpResponseServerError(reason=str(e)) -# TODO 1: profile image file upload -# TODO 2: redo user editing -# TODO 3: django forms -# @login_required -# def get_dist(request): -# ''' -# Upon First registering or changing location information gets representative codes and addes them to the user array -# ''' -# request = urllib2.Request("https://congress.api.sunlightfoundation.com/") -# -# #S3tting the key as the value of an X-APIKEY HTTP request header. -# data = { -# "apikey": APIKEY, -# "fields": [], -# -# } -# request.add_data(json.dumps(data)) -# -# response = urllib2.urlopen(request) -# resp_parsed = json.loads(response.read()) -# reps = [for rep in resp_parsed.data] -# Account.user(request.user).representatives = reps -# - - @login_required def editThread(request): thread_id = request.POST.get("thread_id") diff --git a/project/civiwiki/settings.py b/project/civiwiki/settings.py index 6f8f235ef..f454fb9b1 100644 --- a/project/civiwiki/settings.py +++ b/project/civiwiki/settings.py @@ -98,7 +98,6 @@ # API keys # returns None if not found in os.environ -SUNLIGHT_API_KEY = os.getenv("SUNLIGHT_API_KEY") GOOGLE_API_KEY = os.getenv("GOOGLE_MAP_API_KEY") # Channels Setup diff --git a/project/frontend_views/views.py b/project/frontend_views/views.py index ddca18533..14fd62adf 100644 --- a/project/frontend_views/views.py +++ b/project/frontend_views/views.py @@ -75,7 +75,6 @@ def user_profile(request, username=None): "username": user, "profile_image_form": UpdateProfileImage, "google_map_api_key": settings.GOOGLE_API_KEY, - "sunlight_api_key": settings.SUNLIGHT_API_KEY, } return TemplateResponse(request, "account.html", data) @@ -92,7 +91,6 @@ def user_setup(request): "username": request.user.username, "email": request.user.email, "google_map_api_key": settings.GOOGLE_API_KEY, - "sunlight_api_key": settings.SUNLIGHT_API_KEY, } return TemplateResponse(request, "user-setup.html", data) @@ -196,7 +194,6 @@ def settings_view(request): "username": request.user.username, "email": request.user.email, "google_map_api_key": settings.GOOGLE_API_KEY, - "sunlight_api_key": settings.SUNLIGHT_API_KEY, "lng": request_account.longitude, "lat": request_account.latitude, } diff --git a/project/webapp/static/js/account.js b/project/webapp/static/js/account.js index de4005eeb..fb43963ce 100644 --- a/project/webapp/static/js/account.js +++ b/project/webapp/static/js/account.js @@ -375,23 +375,4 @@ cw.AccountView = BB.View.extend({ return false; }, - // // SunlightAPI related functions - // getLegislators: function(coordinates){ - // var _this = this; - // $.ajax({ - // url: "https://congress.api.sunlightfoundation.com/legislators/locate?latitude=" + coordinates.lat + "&longitude="+ coordinates.lng + "&callback=?", - // headers:{"X-APIKEY": this.sunlightApiKey}, - // dataType: "jsonp", - // success: function(data, status){ - // _this.$('#rep-list').empty(); - // _.each(data.results, function(rep){ - // _this.$('#rep-text').addClass('hide'); - // _this.$('#rep-list').append(_this.repChipTemplate({ rep : rep })); - // }); - // }, - // error: function(){ - // Materialize.toast("Sunlight Error: Could not get representatives", 5000); - // } - // }); - // } }); diff --git a/project/webapp/static/js/utils/locate.js b/project/webapp/static/js/utils/locate.js index 75b8a86da..458983f70 100644 --- a/project/webapp/static/js/utils/locate.js +++ b/project/webapp/static/js/utils/locate.js @@ -115,7 +115,6 @@ cw.MapView = BB.View.extend({ options = options || {}; this.googleMapsApiKey = options.googleMapsApiKey; - this.sunlightApiKey = options.sunlightApiKey; return this; }, @@ -324,32 +323,4 @@ cw.MapView = BB.View.extend({ }; return fullAddress; }, - - // SunlightAPI related functions - getLegislators: function(coordinates) { - var _this = this; - $.ajax({ - url: - "https://congress.api.sunlightfoundation.com/legislators/locate?latitude=" + - coordinates.lat + - "&longitude=" + - coordinates.lng + - "&callback=?", - headers: { "X-APIKEY": this.sunlightApiKey }, - dataType: "jsonp", - success: function(data, status) { - _this.$("#rep-list").empty(); - _.each(data.results, function(rep) { - _this.$("#rep-text").addClass("hide"); - _this.$("#rep-list").append(_this.repChipTemplate({ rep: rep })); - }); - }, - error: function() { - Materialize.toast( - "Sunlight Error: Could not get representatives", - 2000 - ); - } - }); - } }); diff --git a/project/webapp/templates/account.html b/project/webapp/templates/account.html index 7bf7c0f42..ca2be8aac 100644 --- a/project/webapp/templates/account.html +++ b/project/webapp/templates/account.html @@ -74,7 +74,6 @@