mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 12:59:36 +02:00
feat: enhance download command with success and warning messages; update Authentik documentation for clarity
This commit is contained in:
parent
b04a8b8a9e
commit
30f1eaef1c
3 changed files with 10 additions and 3 deletions
|
@ -48,6 +48,7 @@ class Command(BaseCommand):
|
||||||
if res.status_code == 200:
|
if res.status_code == 200:
|
||||||
with open(countries_json_path, 'w') as f:
|
with open(countries_json_path, 'w') as f:
|
||||||
f.write(res.text)
|
f.write(res.text)
|
||||||
|
self.stdout.write(self.style.SUCCESS('countries+regions+states.json downloaded successfully'))
|
||||||
else:
|
else:
|
||||||
self.stdout.write(self.style.ERROR('Error downloading countries+regions+states.json'))
|
self.stdout.write(self.style.ERROR('Error downloading countries+regions+states.json'))
|
||||||
return
|
return
|
||||||
|
@ -56,6 +57,8 @@ class Command(BaseCommand):
|
||||||
return
|
return
|
||||||
elif os.path.getsize(countries_json_path) == 0:
|
elif os.path.getsize(countries_json_path) == 0:
|
||||||
self.stdout.write(self.style.ERROR('countries+regions+states.json is empty'))
|
self.stdout.write(self.style.ERROR('countries+regions+states.json is empty'))
|
||||||
|
elif Country.objects.count() == 0 or Region.objects.count() == 0 or City.objects.count() == 0:
|
||||||
|
self.stdout.write(self.style.WARNING('Some region data is missing. Re-importing all data.'))
|
||||||
else:
|
else:
|
||||||
self.stdout.write(self.style.SUCCESS('Latest country, region, and state data already downloaded.'))
|
self.stdout.write(self.style.SUCCESS('Latest country, region, and state data already downloaded.'))
|
||||||
return
|
return
|
||||||
|
|
|
@ -18,6 +18,7 @@ To enable Authentik as an identity provider, the administrator must first config
|
||||||
4. Set the `Redirect URI` of type `Regex` to `^http://<adventurelog-server-url>/accounts/oidc/.*$` where `<adventurelog-url>` is the URL of your AdventureLog Server service.
|
4. Set the `Redirect URI` of type `Regex` to `^http://<adventurelog-server-url>/accounts/oidc/.*$` where `<adventurelog-url>` is the URL of your AdventureLog Server service.
|
||||||
5. Copy the `Client ID` and `Client Secret` generated by Authentik, you will need these to configure AdventureLog.
|
5. Copy the `Client ID` and `Client Secret` generated by Authentik, you will need these to configure AdventureLog.
|
||||||
6. Create an application in Authentik and assign the provider to it, name the `slug` `adventurelog` or any other name you prefer.
|
6. Create an application in Authentik and assign the provider to it, name the `slug` `adventurelog` or any other name you prefer.
|
||||||
|
7. If you want the logo, you can find it [here](https://adventurelog.app/adventurelog.png).
|
||||||
|
|
||||||
### AdventureLog Configuration
|
### AdventureLog Configuration
|
||||||
|
|
||||||
|
@ -41,7 +42,10 @@ This configuration is done in the [Admin Panel](../../guides/admin_panel.md). Yo
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- Sites: move over the sites you want to enable Authentik on, usually `example.com` and `www.example.com` unless you renamed your sites.
|
::: warning
|
||||||
|
`localhost` is most likely not a valid `server_url` for Authentik in this instance because `localhost` is the server running AdventureLog, not Authentik. You should use the IP address of the server running Authentik or the domain name if you have one.
|
||||||
|
|
||||||
|
- Sites: move over the sites you want to enable Authentik on, usually `example.com` and `www.example.com` unless you renamed your sites.
|
||||||
|
|
||||||
#### What it Should Look Like
|
#### What it Should Look Like
|
||||||
|
|
||||||
|
|
|
@ -561,8 +561,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
(adventure.is_visited && !reverseGeocodePlace?.region_visited) ||
|
adventure.is_visited &&
|
||||||
!reverseGeocodePlace?.city_visited
|
(!reverseGeocodePlace?.region_visited || !reverseGeocodePlace?.city_visited)
|
||||||
) {
|
) {
|
||||||
markVisited();
|
markVisited();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue