Skip to content

Commit

Permalink
Remove default for georepo url
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer committed Aug 21, 2023
1 parent a0c2848 commit 6c25fba
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion django_project/core/migrations/0002_auto_20220621_0516.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='sitepreferences',
name='georepo_url',
field=models.CharField(default='https://staging.georepo.kartoza.com/', max_length=512),
field=models.CharField(default='', max_length=512),
),
migrations.AlterField(
model_name='sitepreferences',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='sitepreferences',
name='georepo_url',
field=models.CharField(default='https://georepo.kartoza.com/', max_length=512),
field=models.CharField(default='', max_length=512),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='sitepreferences',
name='site_url',
field=models.CharField(default='https://geosight.kartoza.com', max_length=512),
field=models.CharField(default='', max_length=512),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.16 on 2023-08-21 02:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0020_sitepreferences_georepo_azure_authentication_url'),
]

operations = [
migrations.AlterField(
model_name='sitepreferences',
name='landing_page_banner_text',
field=models.TextField(blank=True, default='', null=True),
),
]
5 changes: 3 additions & 2 deletions django_project/core/models/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SitePreferences(SingletonModel):

site_url = models.CharField(
max_length=512,
default='https://geosight.kartoza.com'
default=''
)

disclaimer = models.TextField(
Expand All @@ -64,7 +64,7 @@ class SitePreferences(SingletonModel):
# -----------------------------------------------
georepo_url = models.CharField(
max_length=512,
default='https://georepo.kartoza.com/'
default=''
)
georepo_api_key_level_1 = models.CharField(
max_length=512,
Expand All @@ -86,6 +86,7 @@ class SitePreferences(SingletonModel):
upload_to='settings/images'
)
landing_page_banner_text = models.TextField(
null=True, blank=True,
default=''
)

Expand Down
5 changes: 0 additions & 5 deletions django_project/geosight/georepo/request/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ class GeorepoUrl:
def __init__(self, api_key: str = None):
"""Init Class."""
pref = SitePreferences.preferences()
if not pref.georepo_url:
raise GeorepoUrlDoesNotExist()

self.georepo_url = pref.georepo_url.strip('/')
parsed = urlparse(self.georepo_url)
self.georepo_domain = parsed.scheme + '://' + parsed.netloc
Expand Down Expand Up @@ -173,8 +170,6 @@ class GeorepoRequest:
def __init__(self):
"""Init Class."""
pref = SitePreferences.preferences()
if not pref.georepo_url:
raise GeorepoUrlDoesNotExist()
self.urls = GeorepoUrl(
api_key=pref.georepo_api_key_level_4
)
Expand Down

0 comments on commit 6c25fba

Please sign in to comment.