plain.oauth 0.21.0__py3-none-any.whl → 0.22.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ # plain-oauth changelog
2
+
3
+ ## [0.22.0](https://github.com/dropseed/plain/releases/plain-oauth@0.22.0) (2025-06-23)
4
+
5
+ ### What's changed
6
+
7
+ - Updated `OAuthConnection.check()` to accept a single `database` argument instead of the older `databases` list, matching the new single `DATABASE` setting used across the Plain stack ([d346d81](https://github.com/dropseed/plain/commit/d346d81))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - No changes required.
plain/oauth/models.py CHANGED
@@ -164,34 +164,31 @@ class OAuthConnection(models.Model):
164
164
  """
165
165
  errors = super().check(**kwargs)
166
166
 
167
- databases = kwargs.get("databases", None)
168
- if not databases:
167
+ database = kwargs.get("database", False)
168
+ if not database:
169
169
  return errors
170
170
 
171
171
  from .providers import get_provider_keys
172
172
 
173
- for database in databases:
174
- try:
175
- keys_in_db = set(
176
- cls.objects.using(database)
177
- .values_list("provider_key", flat=True)
178
- .distinct()
179
- )
180
- except (OperationalError, ProgrammingError):
181
- # Check runs on manage.py migrate, and the table may not exist yet
182
- # or it may not be installed on the particular database intentionally
183
- continue
184
-
185
- keys_in_settings = set(get_provider_keys())
186
-
187
- if keys_in_db - keys_in_settings:
188
- errors.append(
189
- Error(
190
- "The following OAuth providers are in the database but not in the settings: {}".format(
191
- ", ".join(keys_in_db - keys_in_settings)
192
- ),
193
- id="plain.oauth.E001",
194
- )
173
+ try:
174
+ keys_in_db = set(
175
+ cls.objects.values_list("provider_key", flat=True).distinct()
176
+ )
177
+ except (OperationalError, ProgrammingError):
178
+ # Check runs on manage.py migrate, and the table may not exist yet
179
+ # or it may not be installed on the particular database intentionally
180
+ return errors
181
+
182
+ keys_in_settings = set(get_provider_keys())
183
+
184
+ if keys_in_db - keys_in_settings:
185
+ errors.append(
186
+ Error(
187
+ "The following OAuth providers are in the database but not in the settings: {}".format(
188
+ ", ".join(keys_in_db - keys_in_settings)
189
+ ),
190
+ id="plain.oauth.E001",
195
191
  )
192
+ )
196
193
 
197
194
  return errors
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.oauth
3
- Version: 0.21.0
3
+ Version: 0.22.0
4
4
  Summary: OAuth login and API access for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -1,10 +1,11 @@
1
+ plain/oauth/CHANGELOG.md,sha256=MjX5AOMH3NglFSfsdkEq1Wjh081JiCbRQCeZSyfpSw0,431
1
2
  plain/oauth/README.md,sha256=N8getAUUhLX6P4mg-5P0V41gk5EKBGb8v904OfP2Z9E,9961
2
3
  plain/oauth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
4
  plain/oauth/admin.py,sha256=rqrGRRUVxOlG9wiuXtndIyQxd1VT67cvFy6qWo7LF-Q,1278
4
5
  plain/oauth/config.py,sha256=0Q4IILBKQbIaxqeL9WRTH5Cka-BO3c3SOj1AdQIAJgc,167
5
6
  plain/oauth/default_settings.py,sha256=dlN1J9vSOjjxPNLp-0qe-cLTqwM4E69ZAx_8lpxMhaM,28
6
7
  plain/oauth/exceptions.py,sha256=yoZsq8XgzstuwbE2ihoet0nzpw_sVZgDrwUauh6hhUs,546
7
- plain/oauth/models.py,sha256=_DS8Mv-dn_a9EO63aNb8oV8jxXUgHkoytrMkBritVhQ,6916
8
+ plain/oauth/models.py,sha256=T8VqqxeYGC4xKRVzUKAnc0OU3GN0otDAShDS6CPJhJs,6754
8
9
  plain/oauth/providers.py,sha256=YDftJUMyyfXgsDCkyTNxGwrbwXAowL0Hg6KrwrAN5S0,7793
9
10
  plain/oauth/urls.py,sha256=FYzpQwhvZdcat8n3f7RyA-1Q21finKb8JEyakSOjXXg,696
10
11
  plain/oauth/views.py,sha256=J2NCa37YediBTi82CfRlmsb45hFT6gWN6zMaFHhsDMM,2410
@@ -17,7 +18,7 @@ plain/oauth/migrations/0006_remove_oauthconnection_unique_oauth_provider_user_id
17
18
  plain/oauth/migrations/0007_alter_oauthconnection_provider_key_and_more.py,sha256=B_LW6xG1o_uA13tqUs0KniXl1JBNbQu4wMh2pW8rq5I,675
18
19
  plain/oauth/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
20
  plain/oauth/templates/oauth/callback.html,sha256=4CJG0oAN0xYjw2IPkjaL7B4hwlf9um9LI4CTu50E-yE,173
20
- plain_oauth-0.21.0.dist-info/METADATA,sha256=mdMZjbi7Tp69z0XeUxO2jDUEdLQpZcWqT7dseHafO0Y,10365
21
- plain_oauth-0.21.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- plain_oauth-0.21.0.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
23
- plain_oauth-0.21.0.dist-info/RECORD,,
21
+ plain_oauth-0.22.0.dist-info/METADATA,sha256=Nq5PH0dTgYbkounjfFRfcTo3Nn22M3Fw6x1krqb4kPY,10365
22
+ plain_oauth-0.22.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ plain_oauth-0.22.0.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
24
+ plain_oauth-0.22.0.dist-info/RECORD,,