Coverage for app/venv/lib/python3.14/site-packages/weblate/accounts/migrations/0001_squashed_weblate_5.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 07:15 +0000

1# Copyright © Michal Čihař <michal@weblate.org> 

2# 

3# SPDX-License-Identifier: GPL-3.0-or-later 

4 

5# Generated by Django 4.2.5 on 2023-09-18 08:09 

6 

7import django.core.validators 

8import django.db.models.deletion 

9from django.conf import settings 

10from django.db import migrations, models 

11 

12import weblate.utils.fields 

13import weblate.utils.render 

14 

15 

16class Migration(migrations.Migration): 

17 replaces = [ 

18 ("accounts", "0001_squashed_0019_auto_20200403_2004"), 

19 ("accounts", "0002_profile_nearby_strings"), 

20 ("accounts", "0003_auto_20200630_1321"), 

21 ("accounts", "0004_profile_commented"), 

22 ("accounts", "0005_update_comment_count"), 

23 ("accounts", "0006_auto_20200903_0817"), 

24 ("accounts", "0007_auto_20200904_0840"), 

25 ("accounts", "0008_auto_20200923_1216"), 

26 ("accounts", "0009_auto_20200923_2023"), 

27 ("accounts", "0010_auto_20201213_1314"), 

28 ("accounts", "0011_auto_20210106_1903"), 

29 ("accounts", "0012_profile_auto_watch"), 

30 ("accounts", "0013_auto_20210217_1653"), 

31 ("accounts", "0014_auto_20210506_1421"), 

32 ("accounts", "0015_auto_20210512_1955"), 

33 ("accounts", "0016_alter_auditlog_activity"), 

34 ("accounts", "0017_alter_verifiedemail_email"), 

35 ("accounts", "0018_alter_profile_language"), 

36 ("accounts", "0019_alter_auditlog_user"), 

37 ("accounts", "0020_anonymous_auditlog"), 

38 ("accounts", "0021_profile_commit_email_verifiedemail_is_deliverable"), 

39 ("accounts", "0022_alter_profile_linkedin"), 

40 ("accounts", "0023_cleanup_deleted_users"), 

41 ("accounts", "0024_rename_be_latn"), 

42 ("accounts", "0025_profile_theme"), 

43 ("accounts", "0026_alter_subscription_notification_and_more"), 

44 ("accounts", "0027_alter_subscription_notification"), 

45 ("accounts", "0028_auditlog_params_new"), 

46 ("accounts", "0029_jsonfield"), 

47 ("accounts", "0030_remove_auditlog_params"), 

48 ("accounts", "0031_rename_params_new_auditlog_params"), 

49 ("accounts", "0032_alter_auditlog_activity"), 

50 ("accounts", "0033_alter_auditlog_activity"), 

51 ("accounts", "0034_alter_subscription_frequency_and_more"), 

52 ] 

53 

54 initial = True 

55 

56 dependencies = [ 

57 ("lang", "0001_squashed_weblate_5"), 

58 ("social_django", "0001_initial"), 

59 migrations.swappable_dependency(settings.AUTH_USER_MODEL), 

60 ("authtoken", "0002_auto_20160226_1747"), 

61 ("trans", "0001_squashed_weblate_5"), 

62 ] 

63 

64 operations = [ 

65 migrations.CreateModel( 

66 name="Profile", 

67 fields=[ 

68 ( 

69 "id", 

70 models.AutoField( 

71 auto_created=True, 

72 primary_key=True, 

73 serialize=False, 

74 verbose_name="ID", 

75 ), 

76 ), 

77 ( 

78 "language", 

79 models.CharField( 

80 choices=settings.LANGUAGES, 

81 max_length=10, 

82 verbose_name="Interface Language", 

83 ), 

84 ), 

85 ("suggested", models.IntegerField(db_index=True, default=0)), 

86 ("translated", models.IntegerField(db_index=True, default=0)), 

87 ( 

88 "languages", 

89 models.ManyToManyField( 

90 blank=True, 

91 help_text="Choose the languages you can translate to. These will be offered to you on the dashboard for easier access to your chosen translations.", 

92 to="lang.language", 

93 verbose_name="Translated languages", 

94 ), 

95 ), 

96 ( 

97 "secondary_languages", 

98 models.ManyToManyField( 

99 blank=True, 

100 help_text="Choose languages you can understand, strings in those languages will be shown in addition to the source string.", 

101 related_name="secondary_profile_set", 

102 to="lang.language", 

103 verbose_name="Secondary languages", 

104 ), 

105 ), 

106 ( 

107 "watched", 

108 models.ManyToManyField( 

109 blank=True, 

110 help_text="You can receive notifications for watched projects and they are shown on the dashboard by default.", 

111 to="trans.project", 

112 verbose_name="Watched projects", 

113 ), 

114 ), 

115 ( 

116 "user", 

117 models.OneToOneField( 

118 editable=False, 

119 on_delete=django.db.models.deletion.CASCADE, 

120 to=settings.AUTH_USER_MODEL, 

121 ), 

122 ), 

123 ( 

124 "hide_completed", 

125 models.BooleanField( 

126 default=False, 

127 verbose_name="Hide completed translations on the dashboard", 

128 ), 

129 ), 

130 ( 

131 "secondary_in_zen", 

132 models.BooleanField( 

133 default=True, 

134 verbose_name="Show secondary translations in the Zen mode", 

135 ), 

136 ), 

137 ( 

138 "hide_source_secondary", 

139 models.BooleanField( 

140 default=False, 

141 verbose_name="Hide source if a secondary translation exists", 

142 ), 

143 ), 

144 ( 

145 "dashboard_component_list", 

146 models.ForeignKey( 

147 blank=True, 

148 null=True, 

149 on_delete=django.db.models.deletion.SET_NULL, 

150 to="trans.componentlist", 

151 verbose_name="Default component list", 

152 ), 

153 ), 

154 ( 

155 "dashboard_view", 

156 models.IntegerField( 

157 choices=[ 

158 (1, "Watched translations"), 

159 (6, "Component lists"), 

160 (4, "Component list"), 

161 (5, "Suggested translations"), 

162 ], 

163 default=1, 

164 verbose_name="Default dashboard view", 

165 ), 

166 ), 

167 ( 

168 "editor_link", 

169 models.CharField( 

170 blank=True, 

171 default="", 

172 help_text="Enter a custom URL to be used as link to the source code. You can use {{branch}} for branch, {{filename}} and {{line}} as filename and line placeholders.", 

173 max_length=200, 

174 validators=[weblate.utils.render.validate_editor], 

175 verbose_name="Editor link", 

176 ), 

177 ), 

178 ( 

179 "special_chars", 

180 models.CharField( 

181 blank=True, 

182 default="", 

183 help_text="You can specify additional special visual keyboard characters to be shown while translating. It can be useful for characters you use frequently, but are hard to type on your keyboard.", 

184 max_length=30, 

185 verbose_name="Special characters", 

186 ), 

187 ), 

188 ("uploaded", models.IntegerField(db_index=True, default=0)), 

189 ( 

190 "translate_mode", 

191 models.IntegerField( 

192 choices=[(0, "Full editor"), (1, "Zen mode")], 

193 default=0, 

194 verbose_name="Translation editor mode", 

195 ), 

196 ), 

197 ( 

198 "zen_mode", 

199 models.IntegerField( 

200 choices=[(0, "Top to bottom"), (1, "Side by side")], 

201 default=0, 

202 verbose_name="Zen editor mode", 

203 ), 

204 ), 

205 ( 

206 "nearby_strings", 

207 models.SmallIntegerField( 

208 default=settings.NEARBY_MESSAGES, 

209 help_text="Number of nearby strings to show in each direction in the full editor.", 

210 validators=[ 

211 django.core.validators.MinValueValidator(1), 

212 django.core.validators.MaxValueValidator(50), 

213 ], 

214 verbose_name="Number of nearby strings", 

215 ), 

216 ), 

217 ("commented", models.IntegerField(db_index=True, default=0)), 

218 ( 

219 "company", 

220 models.CharField( 

221 blank=True, max_length=100, verbose_name="Company" 

222 ), 

223 ), 

224 ( 

225 "github", 

226 models.SlugField( 

227 blank=True, db_index=False, verbose_name="GitHub username" 

228 ), 

229 ), 

230 ( 

231 "linkedin", 

232 models.SlugField( 

233 allow_unicode=True, 

234 blank=True, 

235 db_index=False, 

236 help_text="Your LinkedIn profile name from linkedin.com/in/profilename", 

237 verbose_name="LinkedIn profile name", 

238 ), 

239 ), 

240 ( 

241 "location", 

242 models.CharField( 

243 blank=True, max_length=100, verbose_name="Location" 

244 ), 

245 ), 

246 ( 

247 "public_email", 

248 weblate.utils.fields.EmailField( 

249 blank=True, max_length=190, verbose_name="Public e-mail" 

250 ), 

251 ), 

252 ( 

253 "twitter", 

254 models.SlugField( 

255 blank=True, db_index=False, verbose_name="Twitter username" 

256 ), 

257 ), 

258 ("website", models.URLField(blank=True, verbose_name="Website URL")), 

259 ( 

260 "codesite", 

261 models.URLField( 

262 blank=True, 

263 help_text="Link to your code profile for services like Codeberg or GitLab.", 

264 verbose_name="Code site URL", 

265 ), 

266 ), 

267 ( 

268 "fediverse", 

269 models.URLField( 

270 blank=True, 

271 help_text="Link to your Fediverse profile for federated services like Mastodon or diaspora*.", 

272 verbose_name="Fediverse URL", 

273 ), 

274 ), 

275 ( 

276 "liberapay", 

277 models.SlugField( 

278 blank=True, 

279 db_index=False, 

280 help_text="Liberapay is a platform to donate money to teams, organizations and individuals.", 

281 verbose_name="Liberapay username", 

282 ), 

283 ), 

284 ( 

285 "auto_watch", 

286 models.BooleanField( 

287 default=settings.DEFAULT_AUTO_WATCH, 

288 help_text="Whenever you translate a string in a project, you will start watching it.", 

289 verbose_name="Automatically watch projects on contribution", 

290 ), 

291 ), 

292 ( 

293 "commit_email", 

294 weblate.utils.fields.EmailField( 

295 blank=True, max_length=190, verbose_name="Commit e-mail" 

296 ), 

297 ), 

298 ( 

299 "theme", 

300 models.CharField( 

301 choices=[ 

302 ("auto", "Sync with system"), 

303 ("light", "Light"), 

304 ("dark", "Dark"), 

305 ], 

306 default="auto", 

307 max_length=10, 

308 verbose_name="Theme", 

309 ), 

310 ), 

311 ], 

312 options={ 

313 "verbose_name": "User profile", 

314 "verbose_name_plural": "User profiles", 

315 }, 

316 ), 

317 migrations.CreateModel( 

318 name="VerifiedEmail", 

319 fields=[ 

320 ( 

321 "id", 

322 models.AutoField( 

323 auto_created=True, 

324 primary_key=True, 

325 serialize=False, 

326 verbose_name="ID", 

327 ), 

328 ), 

329 ("email", weblate.utils.fields.EmailField(max_length=190)), 

330 ( 

331 "social", 

332 models.ForeignKey( 

333 on_delete=django.db.models.deletion.CASCADE, 

334 to="social_django.usersocialauth", 

335 ), 

336 ), 

337 ("is_deliverable", models.BooleanField(default=True)), 

338 ], 

339 options={ 

340 "verbose_name": "Verified e-mail", 

341 "verbose_name_plural": "Verified e-mails", 

342 }, 

343 ), 

344 migrations.CreateModel( 

345 name="AuditLog", 

346 fields=[ 

347 ( 

348 "id", 

349 models.AutoField( 

350 auto_created=True, 

351 primary_key=True, 

352 serialize=False, 

353 verbose_name="ID", 

354 ), 

355 ), 

356 ( 

357 "activity", 

358 models.CharField( 

359 choices=[ 

360 ("accepted", "accepted"), 

361 ("auth-connect", "auth-connect"), 

362 ("auth-disconnect", "auth-disconnect"), 

363 ("autocreated", "autocreated"), 

364 ("blocked", "blocked"), 

365 ("connect", "connect"), 

366 ("email", "email"), 

367 ("failed-auth", "failed-auth"), 

368 ("full_name", "full_name"), 

369 ("invited", "invited"), 

370 ("locked", "locked"), 

371 ("login", "login"), 

372 ("login-new", "login-new"), 

373 ("password", "password"), 

374 ("register", "register"), 

375 ("removal-request", "removal-request"), 

376 ("removed", "removed"), 

377 ("reset", "reset"), 

378 ("reset-request", "reset-request"), 

379 ("sent-email", "sent-email"), 

380 ("tos", "tos"), 

381 ("trial", "trial"), 

382 ("username", "username"), 

383 ], 

384 db_index=True, 

385 max_length=20, 

386 ), 

387 ), 

388 ("address", models.GenericIPAddressField(null=True)), 

389 ("timestamp", models.DateTimeField(auto_now_add=True, db_index=True)), 

390 ( 

391 "user", 

392 models.ForeignKey( 

393 null=True, 

394 on_delete=django.db.models.deletion.CASCADE, 

395 to=settings.AUTH_USER_MODEL, 

396 ), 

397 ), 

398 ("user_agent", models.CharField(default="", max_length=200)), 

399 ("params", models.JSONField(default=dict)), 

400 ], 

401 options={ 

402 "verbose_name": "Audit log entry", 

403 "verbose_name_plural": "Audit log entries", 

404 }, 

405 ), 

406 migrations.CreateModel( 

407 name="Subscription", 

408 fields=[ 

409 ( 

410 "id", 

411 models.AutoField( 

412 auto_created=True, 

413 primary_key=True, 

414 serialize=False, 

415 verbose_name="ID", 

416 ), 

417 ), 

418 ( 

419 "notification", 

420 models.CharField( 

421 choices=[ 

422 ( 

423 "RepositoryNotification", 

424 "Operation was performed in the repository", 

425 ), 

426 ("LockNotification", "Component was locked or unlocked"), 

427 ("LicenseNotification", "License was changed"), 

428 ("ParseErrorNotification", "Parse error occurred"), 

429 ( 

430 "NewStringNotificaton", 

431 "New string is available for translation", 

432 ), 

433 ( 

434 "NewContributorNotificaton", 

435 "Contributor made their first translation", 

436 ), 

437 ("NewSuggestionNotificaton", "Suggestion was added"), 

438 ("NewCommentNotificaton", "Comment was added"), 

439 ( 

440 "MentionCommentNotificaton", 

441 "You were mentioned in a comment", 

442 ), 

443 ( 

444 "LastAuthorCommentNotificaton", 

445 "Your translation received a comment", 

446 ), 

447 ( 

448 "TranslatedStringNotificaton", 

449 "String was edited by user", 

450 ), 

451 ("ApprovedStringNotificaton", "String was approved"), 

452 ("ChangedStringNotificaton", "String was changed"), 

453 ( 

454 "NewTranslationNotificaton", 

455 "New language was added or requested", 

456 ), 

457 ( 

458 "NewComponentNotificaton", 

459 "New translation component was created", 

460 ), 

461 ( 

462 "NewAnnouncementNotificaton", 

463 "Announcement was published", 

464 ), 

465 ("NewAlertNotificaton", "New alert emerged in a component"), 

466 ("MergeFailureNotification", "Repository operation failed"), 

467 ( 

468 "PendingSuggestionsNotification", 

469 "Pending suggestions exist", 

470 ), 

471 ("ToDoStringsNotification", "Unfinished strings exist"), 

472 ], 

473 max_length=100, 

474 ), 

475 ), 

476 ( 

477 "scope", 

478 models.IntegerField( 

479 choices=[ 

480 (0, "All"), 

481 (10, "Watched"), 

482 (20, "Administered"), 

483 (30, "Project"), 

484 (40, "Component"), 

485 ] 

486 ), 

487 ), 

488 ( 

489 "frequency", 

490 models.IntegerField( 

491 choices=[ 

492 (0, "No notification"), 

493 (1, "Instant notification"), 

494 (2, "Daily digest"), 

495 (3, "Weekly digest"), 

496 (4, "Monthly digest"), 

497 ] 

498 ), 

499 ), 

500 ( 

501 "component", 

502 models.ForeignKey( 

503 null=True, 

504 on_delete=django.db.models.deletion.CASCADE, 

505 to="trans.component", 

506 ), 

507 ), 

508 ( 

509 "project", 

510 models.ForeignKey( 

511 null=True, 

512 on_delete=django.db.models.deletion.CASCADE, 

513 to="trans.project", 

514 ), 

515 ), 

516 ( 

517 "user", 

518 models.ForeignKey( 

519 on_delete=django.db.models.deletion.CASCADE, 

520 to=settings.AUTH_USER_MODEL, 

521 ), 

522 ), 

523 ("onetime", models.BooleanField(default=False)), 

524 ], 

525 options={ 

526 "unique_together": { 

527 ("notification", "scope", "project", "component", "user") 

528 }, 

529 "verbose_name": "Notification subscription", 

530 "verbose_name_plural": "Notification subscriptions", 

531 }, 

532 ), 

533 ]